Skip to content
Account takeover Write-up Intermediate

Account takover via forget password

The password reset flow checked the OTP only when deciding which page to redirect to, not when the new password was actually saved. An attacker could skip the OTP check by sending the password creation request directly, and so set a new password on another user's account.

medium.com

Published on medium.com

Hi guys, Today I want you to share my one of account takeovers in an educational websites which had over 10k users.

AmirReza Marzban, 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 OTP was validated only in the redirect logic of the validation endpoint, while the password creation endpoint trusted the client to have passed that step.

Impact

An attacker could set a new password on another user's account and take it over, though the write-up does not show how the victim's identifier was obtained.

What the attacker needed

Victim's account identifier or phone number; ability to intercept responses

How it was found

  1. Send a password reset request with a correct OTP and note the redirect to the create_password page.
  2. Send the same request with a wrong OTP and note the redirect back to forget_password.
  3. Intercept the wrong-OTP response and replace it with the correct-OTP response.
  4. The browser lands on the create_password page; submit a new password.
  5. The password is changed and the account is taken over.

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 a password, a site sends a one-time code to prove the account is yours. Here the site only checked that code to decide which page to show next, but the page that saves the new password never checked it again. So anyone who knew a victim's phone number or account identifier could jump straight to the save step and pick a new password.

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.