From Cookie to P1: Exploiting a Simple Flaw for Maximum Impact
A predictable USER_ID cookie with a four-letter variable segment allowed attackers to brute-force valid session identifiers and access other users' personal data without authentication. The lack of rate limiting made mass enumeration feasible.
medium.com
Published on medium.com
I’m sharing this write-up based on reports I came across so you can add this method to your bug bounty approach. While experienced hunters may already be familiar with it, it’s always good to revisit techniques that can help in real-world scenarios.
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 session identifier was generated with insufficient randomness (only four uppercase letters) and was not protected by rate limiting or authentication checks.
Impact
Attackers could enumerate thousands of accounts and access personal data without authentication, as there was no rate limiting to prevent brute-force attempts.
What the attacker needed
No account needed; ability to send HTTP requests
The fix
The text recommends using cryptographically secure tokens for session IDs, implementing rate limiting and input validation, and avoiding exposure of sensitive data without authentication checks.
How it was found
- Intercept requests with Burp Suite and observe the cookie structure.
- Generate all four-letter combinations.
- Use Burp Suite Intruder to inject each combination into the cookie.
- Identify valid combinations that return different user data.
- Verify that the responses expose personal information.
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 cookie is a small piece of data a website stores in your browser to remember you. Here, the cookie that identified a user had a short, guessable part, so someone could try many combinations until they found one that belonged to another person. That let them see private information like names and email addresses without logging in.
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.