The $2.3 Million Lesson Hidden in 14 Lines of Code
The API middleware only checked that a request had a valid token, not whether the requested resource belonged to that user. An attacker with a free account could change an identifier in a URL to read other customers' data.
medium.com
Published on medium.com
They had genuine product-market fit, a motivated team, and a Series A term sheet on the table. What they didn’t have — and didn’t know they were missing — was a single authorization check in their API middleware.
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 middleware verified authentication (a valid token) but never performed resource-level authorization to confirm the requested record belonged to the requesting user.
Impact
An attacker could read any other customer's data, and the breach led to data export, customer churn, and the company running out of runway.
What the attacker needed
A free account; valid authentication token
The fix
The fix was to add a single ownership check to the middleware, which the text says would have taken about 90 minutes.
How it was found
- Sign up for a free account and obtain a valid token.
- Send an API request for a resource using an identifier that belongs to another customer.
- Change the identifier in the URL to access another customer's data.
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 system gives you a token that proves who you are. But the system also needs to check that you are allowed to see the specific record you are asking for. Here, it only checked the token, so any logged-in user could read anyone else's data by changing a number in the web address.
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.