User Role Controlled By Request Parameter -Privilege Escalation W
The application decided whether a user was an administrator by reading an Admin flag sent in the request, so a normal user could flip it to true and reach admin functions. The attacker could view the admin panel and delete other users without having admin rights.
Published on medium.com
After authenticating with a standard user account, application traffic was intercepted using the Networks tab of the Developer tools on the browser to identify:
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 a client-supplied Admin parameter for authorization instead of checking the user's role stored server-side.
Impact
A low-privileged user could view the admin panel and delete other users, and the text claims wider admin actions and privilege escalation across the application could follow.
What the attacker needed
A standard user account; ability to intercept and edit requests
The fix
Authorization should be enforced on the server using the user's stored role, ignoring any role indicator supplied by the client.
How it was found
- Log in with the standard user account and inspect the requests in the browser's network tab.
- Notice a hidden request parameter that carries the admin flag set to false.
- Capture the request in an intercepting proxy and change the admin flag to true.
- Send a request to the admin path with the flag set to true.
- Use the admin panel to delete another user, again setting the flag to true.
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.
When you log in, the server should decide what you are allowed to do. Here the server instead asked the browser, through a value in the request, whether the user was an admin. Anyone can edit that value before sending it, so a normal user could pretend to be an admin.
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.