Skip to content
Account takeover Write-up Intermediate

When OTPs Lose Their Identity: Breaking an Email Verification Flo

The email change flow reused the same OTP across multiple requests and tied it to the flow rather than the email address, so an attacker could change an account's email to an address they did not control. The attacker could then potentially take over the account by changing the email to their own address.

0xTaki Follow

Published on medium.com

One late night while hunting on a public VDP program, I stumbled into one of those moments that instantly changes the way you look at a system.

0xTaki, 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

Likely the backend associated the OTP with the verification session or request sequence instead of binding it to the specific email address being verified.

Impact

An attacker could change an account's email to an address they do not control, potentially leading to account takeover, but the issue did not apply to already registered emails, limiting practical impact.

What the attacker needed

Attacker can initiate email change; victim's email not already registered

How it was found

  1. Send an email change request with the victim's email address.
  2. Send another email change request with the attacker's email address.
  3. Receive the OTP at the attacker's email address.
  4. Submit the OTP code.
  5. The account email is changed to the victim's email address from the first request.

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 change your email, the site sends a one-time code (OTP) to the new address to prove you own it. Here, the site kept using the same code even when the email address in the request changed, and it changed the account to the first email in the sequence rather than the one that received the code. This means someone could change your account's email without actually controlling that email address.

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.