Critical Privilege Escalation: Viewer Can Gain Admin Access
A user with the Viewer role could change their own role to Admin by sending a crafted request to the user management endpoint, which lacked a permission check. This allowed the attacker to gain full control over the organisation.
medium.com
Published on medium.com
This time I am going to talk about a privilege escalation issue that I have found on a program during testing. I was testing this let’s say test.com application from some days and I didn’t found any access control issues as they were to strict with the permissions.
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 endpoint that handles role changes did not verify that the requesting user had permission to modify roles, allowing any authenticated user to change their own role.
Impact
A viewer could escalate their privileges to admin, gaining full control over the organisation.
What the attacker needed
A valid account with Viewer role
The fix
The endpoint should enforce proper permission checks to ensure only authorised users can change roles.
How it was found
- Log in as a user with the Viewer role.
- Capture the request to change a user's role.
- Modify the request to set your own role to Admin.
- Send the request with your own cookies and CSRF token.
- Observe that your role is changed to Admin.
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.
In many applications, users have different roles like viewer or admin that control what they can do. A privilege escalation bug happens when a lower-privileged user can trick the system into giving them higher privileges. Here, a viewer could simply send a request to change their own role to admin, and the system allowed it without checking if they were allowed to do so.
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.