Skip to content
Account takeover Write-up Intermediate

From OTP to ATO: A $10K Mobile Bug in State Validation

The mobile app's password reset and login flows did not verify OTP completion on the server, relying on client-side state. An attacker with only a victim's email could manipulate API responses to bypass OTP and change the password, leading to full account takeover.

medium.com

Published on medium.com

Account takeovers (ATO) usually rely on social engineering or password reuse. But what if you could bypass the entire login flow just by modifying the response of a mobile app?

Damian Gambacorta, 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 did not validate the OTP state and trusted client-side responses to decide whether previous steps were completed.

Impact

An attacker could take over any account using only the victim's email address, without needing the password or OTP, and with no user interaction.

What the attacker needed

Victim's email address; ability to intercept app traffic (SSL pinning bypass)

The fix

The server should enforce OTP validation and not trust client-side state; the text does not state whether it was fixed.

How it was found

  1. Bypass SSL pinning to intercept the app's traffic.
  2. Trigger a password reset and capture the response from the OTP send endpoint.
  3. Use Burp Match & Replace to change needLogin from true to false and clear OTP error codes.
  4. Inject fake loginOtpToken and key values into the response.
  5. Submit a new password to the password reset endpoint, which accepts it without OTP verification.
  6. For login, modify the device ID and replace OTP enforcement responses to simulate success, then log in with the new 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 reset a password or log in from a new device, apps often send a one-time code (OTP) to your phone. The app is supposed to check that code on its server before letting you continue. Here, the server never checked; it trusted the app to say the code was correct. An attacker could fake the app's messages to skip the code and take over any 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.

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.