Skip to content
Account takeover Write-up Beginner

Hijacking Email Verification: A Real-World Account Takeover via

The resend OTP endpoint accepted a client-supplied email address instead of binding it to the original registration session, so an attacker could start a signup with one email and then redirect the OTP to a different email they controlled. This allowed the attacker to create an account that appeared to belong to the victim's email but was actually controlled by the attacker's email.

Amandeep Singh Follow

Published on medium.com

In a recent penetration test, I stumbled upon a surprisingly simple but highly impactful account takeover vulnerability that abused the “Resend OTP” functionality during email verification. While the issue was marked as a duplicate by the bug bounty program, the learning and exploitation flow are worth documenting for…

Amandeep Singh, 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 server trusted the client-supplied email address during the resend OTP step instead of storing the original email server-side and tying it to the session.

Impact

An attacker could achieve full account takeover by pre-registering with a victim's email and then swapping in their own email to receive the OTP, with the victim unaware that OTPs are being sent to the attacker.

What the attacker needed

Attacker can start registration with victim's email; attacker controls another email address; attacker can intercept and modify requests

The fix

The application should store the original email server-side once registration starts, disallow client-side changes to the email during the OTP process, and tie OTPs to a short-lived token or session.

How it was found

  1. Start registration with email A.
  2. Request an OTP to email A.
  3. Intercept the 'Resend OTP' request.
  4. Change the email in the request to email B.
  5. Receive the OTP at email B.
  6. Complete verification using the OTP received at email B.

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 sign up, the app sends a one-time code (OTP) to your email to prove it is yours. Here, the app let the user change which email the code was sent to during the 'resend' step, so an attacker could receive the code for someone else's email and take over the account.

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 Amandeep Singh

View all

2 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.