From Customer to Admin: Real-World IDOR in an E-Commerce Platform
During registration, the server accepted a user-supplied 'account' parameter that set the account role, so changing it from customer to administrator created an administrator account. The attacker gained full admin access to the production e-commerce platform.
medium.com
Published on medium.com
When working on bug bounty programs, I often stick to my basic playbook for testing IDOR (Insecure Direct Object Reference) vulnerabilities: Create two separate user accounts, compare responses, and look for object references or IDs I can tamper with.
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 backend used a client-supplied 'account' parameter to define the role during registration without validating it server-side against an allowed value.
Impact
The attacker obtained a full administrator account on a live production e-commerce platform, with access to user orders, payment records, admin dashboards and potential code deployment sections, though the researcher did not proceed further out of scope respect.
What the attacker needed
Ability to intercept and modify requests; a registration form that accepts role parameters
The fix
The registration workflow should ignore client-supplied role fields and assign roles server-side from a fixed allow-list.
How it was found
- Create a standard user account while intercepting the registration request.
- Notice the response contains a role-like parameter set to customer.
- Try changing the 'user' parameter to admin, which the server rejects.
- Find a second parameter named 'account' also set to customer.
- Change 'account' to administrator and send the request.
- The account is created with administrator privileges.
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 website decides what kind of account you get. Here, the sign-up request included a hidden field that told the server which role to assign, and the server trusted whatever value the user sent. By changing that value, the person signing up could make themselves an administrator instead of a normal customer.
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.