Skip to content
Account takeover Write-up Intermediate

“Day 26: The Logic Bomb — How I Hacked 0.1% of a Million-

The password reset flow allowed multiple reset tokens to remain valid simultaneously, and token validation was not atomic with the password update. An attacker could request many tokens and race to set a new password before the victim used their link, enabling account takeover.

Aman Sharma Follow

Published on infosecwriteups.com

Hey everyone! We’re at Day 25 of our bug bounty deep dive, and today’s find is a classic example of why you should never trust a process just because it looks secure.

Aman Sharma, on infosecwriteups.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 server did not invalidate previous reset tokens when a new one was issued, and token validation was not atomic with the password update, leaving a race window.

Impact

An attacker could reliably take over accounts by racing to set a new password before the victim used their reset link, though the text does not state whether any defence limited the attack.

What the attacker needed

Attacker can request password resets for victim's email; victim does not use their reset link immediately; attacker can send many reset requests quickly

The fix

The server should invalidate all previous reset tokens when a new one is issued and perform token validation and password update atomically in a single transaction, with rate limiting on the reset request endpoint.

How it was found

  1. Request a password reset for the test account and capture the token.
  2. Immediately request a second reset for the same account, obtaining a second token.
  3. Load the reset form with the first token and enter a new password without submitting.
  4. Load the reset form with the second token in a different browser.
  5. Submit the first form; it succeeds.
  6. Submit the second form; it also succeeds and overwrites the password.

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 forget your password, a website emails you a special link with a secret code (a token) to prove it's you. This site made a mistake: it let several of these codes work at the same time, and it didn't check the code at the exact moment you set a new password. An attacker could ask for many codes and quickly use one to change the password before the real owner clicked their link.

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.

More by Aman Sharma

View all

34 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.