Skip to content
Account takeover Write-up Intermediate

Bug Bounty $$$ Write-up: OTP Bypass

The password reset flow issued a token after OTP validation that was not tied to the user, did not expire, and could be reused. An attacker who obtained one valid token could reset the password of any account by changing the email address in the reset request.

medium.com

Published on medium.com

Hey folks 👋 Here’s an interesting OTP bypass I discovered during a recent bug bounty hunt. This one looks secure at first glance (OTP expiry + rate limiting ), but the actual flaw sits in how the backend trusts a token after validation.

secureITmania, on medium.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

The post-validation token was not bound to the user, did not expire, and was not single-use, and the backend trusted it without checking it matched the email in the reset request.

Impact

An attacker could take over any account without access to the victim's email or the OTP, using a single valid token.

What the attacker needed

A free account; ability to receive OTP on own email

The fix

The token should be bound to the user, expire after a short time, be single-use, and the email in the reset request should be checked against the OTP-validated user.

How it was found

  1. Request a password reset for the attacker's own email address.
  2. Validate the OTP sent to the attacker's email.
  3. Receive a responseIdOTP token from the server.
  4. Submit a password reset for the victim's email address using the same token.
  5. The server accepts the request and the victim's password is changed.

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 site often emails you a one-time code (OTP) to prove you own the account. After you enter that code, the site gives your browser a temporary pass (a token) so you can set a new password. Here, that pass was not linked to your account and never expired, so anyone who got one could use it to change the password of any other user.

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.

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.