Unauthorized Role Assignment via Registration using OPTIONS Metho
The registration API accepted a user-controlled role field and allowed self-registration with privileged roles not shown in the UI. An attacker could register an account with an elevated role such as Analyst.
While testing a public registration flow on a bug bounty target, I wasn’t looking for privilege escalation.
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 backend trusted a client-supplied role value and did not enforce a whitelist of roles allowed for self-registration.
Impact
An attacker could self-register with a privileged role, though the report notes the immediate impact appeared limited.
What the attacker needed
Public registration endpoint; ability to intercept HTTP requests
The fix
The backend should enforce a server-side whitelist of roles permitted for self-registration and reject any other values.
How it was found
- Send an OPTIONS request to the registration endpoint to discover accepted fields and values.
- Complete the registration form normally and intercept the request.
- Replace the role value with a privileged role not shown in the UI and forward the request.
- Verify the email, log in, and check that the account has the privileged role.
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 a server. This server trusted a hidden field that said what kind of user you are, so someone could change it to a more powerful role. The website only hid those roles in the form, but did not check them on the server.
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.