How I discovered a Critical Vulnerability during a Pentest : IDOR to Privilege Escalation
A support administrator could change a user's role by sending a GraphQL request with a role ID, and the server did not check whether the caller was allowed to assign that role. By guessing role IDs, the attacker found the super admin role ID and assigned it to themselves, gaining full administrative access.
Published on medium.com
Hello folks 👋🏼, I hope you are doing well. My name is Ravindu, a Security Researcher and Cybersecurity Engineer.
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 role ID supplied in the GraphQL request without verifying that the caller had permission to assign that particular role.
What the attacker needed
A support administrator account
The fix
The server should check that the caller is allowed to assign the requested role before applying the change.
How it was found
- Log in with the Trainee and Support Administrator roles.
- Use the UI to change or add a role as Training Manager and intercept the request.
- Notice that the request contains role IDs for the user's assigned roles.
- Brute-force the role ID values to find the super admin role ID.
- Send a request to update the user's role to the super admin role ID.
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 this app, some users have limited admin powers, like a support administrator. The app let that support admin change other users' roles by sending a request with a role number. The server did not check if the support admin was allowed to give out the most powerful role, so the tester simply tried different role numbers until they found the super admin one and gave it to themselves.
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.