When a Simple Parameter Exposes All Users: A Real-World API Autho
An API endpoint decided which users' data to return based on a client-supplied query parameter, so changing that parameter caused the response to include other users' records. An attacker could enumerate all users, including administrators, and obtain their email addresses, usernames and internal identifiers.
While testing an application using Burp Suite, I came across a critical vulnerability that highlights a common but dangerous mistake in API design: broken access control via query parameter manipulation.
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
The API trusted a client-controlled query parameter to decide which users' records to return, instead of enforcing authorisation on the server from the authenticated session.
Impact
An attacker could enumerate all users of the platform, identify admin accounts and target users with phishing; the text does not mention any defence that limited the exposure.
What the attacker needed
An authenticated account; ability to intercept and edit requests
The fix
Authorisation should be enforced server-side from the authenticated session and stored roles, and parameters such as admin=true should be removed from client requests.
How it was found
- Intercept a request to the users API endpoint that includes the current_user parameter set to true.
- Change the parameter value to false and observe that the response now contains multiple users.
- Change the parameter to admin=true and observe that even more sensitive data, including administrative accounts, is returned.
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.
An API is the part of a website that supplies data to the page. Here the server asked the browser which data to send back, instead of deciding for itself based on who was logged in. By editing that request, the tester made the server hand over other people's account details.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.