Skip to content
Account takeover Write-up Intermediate

Account Takeover Based on Deep Understanding of the Target

The password reset flow for mobile numbers had a 'Reverse Confirmation' mode where the user texts an OTP to the backend, and the server did not validate the CSRF token and accepted a placeholder code. An attacker could activate this mode, lock the victim's account to force a reset, and race to submit the password reset request first, setting an arbitrary password.

medium.com

Published on medium.com

Hi there! Maverick here, and in this write-up, I’ll walk you through an interesting account takeover scenario.

Erfan Tavakoli, 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 server did not validate the CSRF token and accepted a placeholder value for the OTP code in the password reset request, allowing an attacker to submit the reset before the victim.

Impact

An attacker could take over a victim's account by setting a new password, but the attack requires the victim to confirm their phone number via text, which may involve social engineering or account locking.

What the attacker needed

Victim's mobile number; victim confirms phone number via text; attacker acts before victim

How it was found

  1. Send at least six OTP requests to the victim's mobile number to activate Reverse Confirmation.
  2. Lock the victim's account to force them to reset their password.
  3. Continuously poll the isPhoneConfirmed endpoint to detect when the victim confirms their phone number.
  4. Immediately send a password reset request to /api/v1/users/recovery with the victim's number and a placeholder code.

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 website often sends a code to your phone or email to prove it's you. This report found a special mode where you instead text a code back to the website. The website didn't properly check that the request to change the password came from the real user, so an attacker could jump in and set a new password for the victim before the victim finished.

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.