Broken Access Control part-6 : User ID controlled by request par
The user account page used a GUID in a request parameter to identify the user, but the server did not check whether the logged-in user was allowed to access that GUID. An attacker could change the parameter to another user's GUID and view that user's page, including their API key.
Published on medium.com
In the world of web application security testing, I often come across access patterns that seem trivial but hold the potential for serious loopholes — one of which is request parameter-based access control.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server trusted the user ID supplied in the request parameter without verifying that the logged-in user was authorised to access that user's data.
Impact
An attacker could view another user's account page and obtain their API key, leading to horizontal privilege escalation.
What the attacker needed
A free account; victim's user ID known or leaked
The fix
The application should perform a server-side authorization check to confirm the logged-in user has rights to the requested object, rather than relying on request parameters.
How it was found
- Log in to the lab with the given credentials.
- Open a post uploaded by user carlos and click the username.
- Notice the user ID included when accessing carlos's post.
- Replace your own user ID with carlos's user ID in the request.
- Access carlos's user page and obtain the API key.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A web app sometimes puts an identifier in the URL to say whose data to show. If the server does not check that the person asking is allowed to see that data, anyone who learns another person's identifier can view their information. Here the identifier was hard to guess, but it could still be found on a public post.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.