Skip to content
Account takeover Write-up Intermediate

One OTP to Rule Them All: How I Replayed a Single Response and L

The OTP verification flow relied on the client trusting a JSON response containing a session URL, so a single captured successful response could be replayed to log in with any incorrect OTP. An attacker could therefore bypass OTP validation entirely after completing the flow once.

Nayan Choudhary Follow

Published on medium.com

I discovered a high-severity bug on target.com where the client blindly trusted a field in the server's JSON response—specifically, a field called url.

Nayan Choudhary, 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 frontend trusted a client-side JSON response field (status and url) to decide login success, with no server-side revalidation of the OTP on each attempt.

Impact

An attacker who completes the OTP flow once could replay the saved response to log in with invalid OTPs, potentially exposing sensitive user data.

What the attacker needed

Attacker has an account; attacker completes OTP once; ability to intercept responses

The fix

OTP validation should be enforced server-side, OTPs made one-time and short-lived, session tokens kept out of frontend-parsable fields, and responses signed or encrypted to detect tampering.

How it was found

  1. Visit the OTP verification page.
  2. Enter a correct OTP and capture the successful JSON response.
  3. Save that response for later.
  4. Enter an incorrect OTP and intercept the failure response.
  5. Replace the failure response with the previously captured successful response.
  6. The frontend accepts it and logs the user in.

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.

A one-time password (OTP) is a short code sent to your phone or email to prove it is you. Here, the website's frontend decided whether login succeeded by reading a message from the server, and it never asked the server again to confirm the code. So if someone saved one successful reply, they could show that same reply later and the page would let them in without a real 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.

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.