Privilege Escalation: From User to Admin.
The registration endpoint of a deliberately vulnerable practice shop accepted a client-supplied admin flag, so anyone could sign up with administrator rights. An attacker could then reach admin-only pages, user records and order data.
medium.com
Published on medium.com
In this post, I’ll share how a simple bug can lead to million-dollar loss. Have you ever wonder how it is possible?
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 a role field sent by the client during registration instead of deciding the role itself.
What the attacker needed
A free account on the practice site; an intercepting proxy such as Burp Suite
The fix
The server should ignore any role field sent by the client and assign roles itself, rejecting unexpected fields.
How it was found
- Register a normal account through the sign-up form.
- Turn on interception in the proxy tool and submit the form.
- Send the captured registration request to the repeater.
- Change the admin flag in the request body from false to true and send it.
- Log in on the admin page with the same credentials.
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 sends your details to its server. Here it also sent a hidden 'are you an admin?' flag, and the server believed whatever the browser said. By flipping that flag before sending, a normal visitor could become an administrator.
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.