How I Bypassed an Account ID Check to Steal an API Key
The application used a user-controlled 'id' parameter to decide which account page to show, without checking it against the logged-in session. An attacker could change that parameter to another user's name and read that user's API key.
medium.com
Published on medium.com
In the world of web security, some of the most critical vulnerabilities stem from a simple failure
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 trusted the client-supplied 'id' parameter for authorisation instead of deriving the user identity from the session.
Impact
An attacker could view another user's account page and steal their API key.
What the attacker needed
A valid account (wiener); ability to intercept and modify requests
How it was found
- Log in as the user wiener and open the My Account page.
- Intercept the request and note the id parameter in the URL.
- Change the id parameter from wiener to carlos and forward the request.
- Read carlos's API key from the returned page.
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 log in, the website should use your session (like a temporary pass) to know who you are. Here, the page also took a name from the web address and showed that person's account. By changing the name in the address, anyone could see someone else's private API key.
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.