Exploiting Insecure Direct Object References (IDOR) in Access Con
The account page used a user ID taken directly from the URL to decide whose data to show, without checking that the logged-in user owned that ID. An attacker could change the ID to another user's value and read that user's account details, including their API key.
Published on medium.com
Access control vulnerabilities can lead to unauthorized data exposure, allowing attackers to access other users’ sensitive information. In this PortSwigger lab, we’ll explore how User ID controlled by request parameter can be exploited to gain access to another user’s account and retrieve their API key.
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 used the user ID from the request parameter to look up account data without verifying that it matched the authenticated session's user.
Impact
An attacker could read another user's account page and obtain that user's API key, which may allow further actions as that user.
What the attacker needed
A free account; knowledge of another user's ID
The fix
The application should check on the server that the requested account belongs to the authenticated session before returning any data.
How it was found
- Log in with the provided low-privilege account.
- Open the account page and note the user ID parameter in the URL.
- Find another user's ID by viewing a blog post authored by that user.
- Replace your own ID in the account page URL with the other user's ID.
- Load the modified URL to view the other user's account page and read their API key.
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 web app often puts an identifier in the address bar, such as ?id=abc, to choose which record to display. If the server trusts that identifier without also checking that the logged-in person is allowed to see that record, anyone can swap in a different identifier. Here, changing the number in the address bar showed another person's account page and their secret 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.