Broken Access Control: User Role Manipulation
The application trusted client-controlled data to decide user privileges, allowing a normal user to become an administrator by changing a request parameter or adding a role field to a profile update. This let the attacker access the admin panel and delete other users.
medium.com
Published on medium.com
Broken Access Control occurs when an application trusts client-controlled data to decide user privileges. These two labs demonstrate how easily administrative access can be gained when role validation is implemented incorrectly.
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 server trusted client-controlled data (a cookie/parameter or extra JSON field) to set user privileges instead of checking authorisation on the server.
Impact
A normal user could become an administrator, access the admin panel, and delete other users.
What the attacker needed
A normal user account; ability to intercept and modify requests
The fix
Authorisation decisions should be enforced server-side and must not rely on client-controlled parameters or accept sensitive fields like roles in profile updates.
How it was found
- Log in as a normal user.
- Intercept the request with Burp Suite.
- Change the admin flag from false to true (Lab 3) or add a roleid field to the email update request (Lab 4).
- Forward the modified request.
- Access the admin panel and delete another user.
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.
Broken access control means the website lets you do things you should not be allowed to do, like becoming an admin. Here, the site believed whatever the user's browser said about their role, so changing a simple value in the request gave full admin rights.
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.