“Day 27: The IDOR Epidemic — How Changing a Single Number Unlocked a Million User Profiles”
An API endpoint returned full user profiles, including private data, based solely on a sequential user ID in the URL without checking that the authenticated user owned that ID. An attacker could change the ID to read any user's email, date of birth, health metrics and workout history, even for private profiles.
Published on infosecwriteups.com
Welcome back to Day 27 of our bug bounty journey! Today’s tale is a classic, but with a twist that made it one of my most significant finds.
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 API endpoint lacked an authorization check comparing the authenticated user's ID with the requested user ID, so it returned any profile by ID.
Impact
An attacker could read the private health data, email addresses and dates of birth of any user, potentially all million+ users, because the endpoint returned data even for profiles set to private.
What the attacker needed
A valid user account and token; knowledge of another user's ID; sequential user IDs
The fix
The endpoint should be fixed by adding an access control check that verifies the authenticated user matches the requested user ID, and optionally by using unpredictable identifiers instead of sequential IDs.
How it was found
- Map the API and find the profile endpoint that returns detailed user data.
- Change the user ID in the request from your own to another user's ID.
- Observe that the response returns the other user's full profile, including private fields.
- Enumerate sequential user IDs with a script to extract many profiles.
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.
An IDOR (Insecure Direct Object Reference) happens when a website uses a simple identifier, like a number in the URL, to decide which record to show, but forgets to check that the person asking is allowed to see that record. Here, changing the number in the address bar let the author view other people's private profiles. The fix is to always verify that the logged-in user matches the requested record.
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.