Privilege Escalation via Registration Feature Writeup
The registration endpoint accepted a user-supplied role field, so an attacker could register with the role set to Admin instead of the default User. The attacker then had access to admin-only management features such as products, orders, discounts, categories, user accounts and pickup requests.
medium.com
Published on medium.com
Sometimes, the biggest vulnerabilities hide in the most basic features. Recently, I was testing a web application when I stumbled upon a criticalprivilege escalation bug — all because the system trusted user input a little too much.
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 the role value sent by the client during registration instead of assigning a default role itself.
Impact
An attacker could create an administrator account and reach admin-only management features including products, orders, discounts, categories, user accounts and pickup requests.
What the attacker needed
Access to the registration form; ability to intercept and edit requests
The fix
The server should ignore any role value sent by the client during registration and assign roles itself.
How it was found
- Open the registration form and submit a normal sign-up.
- Capture the registration request and notice the role field in the body.
- Change the role value from User to Admin and forward the request.
- Log in with the new account and confirm it has admin access.
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 sign up, the server should decide what permissions your new account gets. Here, the sign-up form let the person signing up choose their own role, and the server believed it. By asking for the Admin role instead of the normal User role, the tester got an administrator account.
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.