Account Takeover Through Rate-Limit Bypass — Bug Bounty Tuesday
The password reset flow used a six-digit code and rate-limited attempts, but the limit could be bypassed by sending two X-Forwarded-For headers and changing the second IP. An attacker could then brute-force the code and take over any account.
kerstan - Medium Read writing from kerstan on Medium. AI | Programming Knowledge | Bug Bounty Hunter X: https://x.com/kerstanhuntermedium.com
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 rate limiter keyed on a client-supplied X-Forwarded-For header instead of the real connection IP, and it used the last value in a duplicated header.
Impact
An attacker could take over any account in the application without authorization.
What the attacker needed
Access to the password reset endpoint; ability to send custom headers
How it was found
- Start a password reset for a target account.
- Send the reset verification request with two X-Forwarded-For headers.
- Change the IP in the second X-Forwarded-For header for each attempt.
- Keep trying codes until the correct one is found.
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 reset a password, the site emails you a short number code. The site tries to stop guessing by limiting how many tries you get. Here, the site trusted a fake header that claimed the request came from a different IP address, so the limit never kicked in and someone could guess the code.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.