Skip to content
Access control Write-up Intermediate

Privilege Escalation

An admin user creation endpoint did not validate the role ID, allowing a normal admin to create a user with superuser privileges. Additionally, many endpoints lacked authorization checks, enabling any authenticated user to perform privileged actions and access other users' data by changing object identifiers.

Gaurav Narwani Follow

Published on gauravnarwani.com

Hello Guys, today we are going to talk about a very interesting vulnerability I found in a private program. The vulnerability allowed an attacker to perform the highest admin privileged task being just a normal user.

admin, on gauravnarwani.com

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 application did not enforce authorization checks on the role parameter during user creation and on other endpoints, trusting user-supplied input.

Impact

An attacker with admin privileges could create a superuser account and gain full control of the application, and any authenticated user could perform unauthorized actions and access other users' data.

What the attacker needed

Valid admin credentials; valid low-privileged user credentials

The fix

The application should enforce proper authorization checks on all endpoints, ensuring users can only perform actions and access resources they are permitted to.

How it was found

  1. Log in as an admin and find the endpoint to create a user.
  2. Send a POST request with roleId-3 (moderator) and roleId-4 (vendor) to create users with those roles.
  3. Modify the roleId to 1 in the POST request.
  4. Log in with the newly created user credentials to confirm superuser privileges.
  5. Capture superuser endpoints and replay them with a less privileged user's session to test for IDOR.

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.

Privilege escalation means a user can do things they are not supposed to, like a normal user becoming an admin. Here, the application trusted a hidden field that said what role a new user should have, and it did not check if the person creating the user was allowed to assign that role. Also, many actions did not check if the user had permission, so anyone could change data by altering numbers in requests.

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.

More by Gaurav Narwani

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.