Day 13: Chaining Improper Authentication to IDOR and No Rate Limi
An API endpoint for user data returned records without proper authentication when the CSRF token was omitted, and lacked rate limiting, allowing an attacker to enumerate numeric IDs and obtain session tokens and plaintext passwords for many accounts.
Hey folks! Hope you’re all doing well.
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 endpoint relied on the presence of a CSRF token as its only access check, so removing the token bypassed authentication, and no rate limiting allowed mass enumeration.
What the attacker needed
Access to the API endpoint; ability to send requests without CSRF token
How it was found
- Send a request to the user ID endpoint and observe a 401 Unauthorized response.
- Remove the CSRF token from the request headers and resend it.
- Observe a 200 OK response containing user data, confirming the IDOR.
- Create a second account to obtain a new user ID and replace the ID in the request.
- Remove the CSRF token again and confirm a 200 OK response.
- Brute-force thousands of numeric IDs to collect session tokens and passwords.
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 API is a way for programs to talk to each other. This one handed out other people's account details, including their login tokens and passwords, to anyone who asked in the right way. Because there was no limit on how many times you could ask, someone could simply try every user number in turn and collect many accounts.
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.