HOW I Hacked “Welcome to Secure Portal” — IDOR + BAC (P
An agent-level user could change their own role to administrator by tampering with a role identifier in an update request, because the server trusted a client-supplied value. The author also notes that API documentation for the super-admin role made the request easy to craft.
As a Part-time Hunter, it is tough to manage my time to write about my findings! But I always love to share my findings with the community from Twitter/X.
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 server accepted a role identifier from the request body without checking that the caller was allowed to assign that role.
Impact
An agent could escalate their own privileges to administrator, gaining the portal's administrative capabilities.
What the attacker needed
An agent account; a super-admin account for testing; access to API documentation
The fix
The server should ignore client-supplied role values and only allow role changes from an authorised administrative context.
How it was found
- Log in as an agent and note the session cookie.
- From a super-admin account, change an agent's details and capture the update request.
- Replace the admin cookie with the agent cookie in that request.
- Change the role identifier in the request body to the admin value and send it.
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.
A portal lets staff with limited rights (agents) edit their own profile. The request that saves the profile includes a hidden field saying which role the user has. By changing that number, the agent told the server to make them an administrator, and the server believed it.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.