Skip to content
Account takeover Write-up Beginner

Account Takeover via Broken Password Reset Validation

The password reset endpoint accepted a user-supplied email address without verifying it matched the OTP-verified session, allowing an attacker to reset any user's password. An attacker could take over any account by starting a reset for their own email, completing OTP verification, then swapping the email to the victim's address.

z9mohamed74 Follow

Published on medium.com

Severity: Critical Type: Authentication Bypass / Account Takeover (ATO) CWE: CWE-640: Weak Password Recovery Mechanism for Forgotten Password CVSS 3.1: ~9.1 (Critical)

Mohamed Abd almalek, 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 /validate-password endpoint updates the password based only on the email parameter in the request body, without checking that the active password reset session is linked to the same email.

Impact

Any user account could be fully taken over without prior access or knowledge of the existing password, and the attacker bypasses OTP rate-limiting because the reset is started for their own email.

What the attacker needed

Attacker has an email address; victim's email address is known; attacker can intercept HTTP requests

The fix

The server should keep a server-side session or token after OTP verification, bind it to the specific email address that requested the reset, and reject any attempt to change a password for an email that does not match the authenticated reset session.

How it was found

  1. Go to the password reset page and enter the attacker's email to request an OTP.
  2. Retrieve the OTP from the attacker's inbox and submit it.
  3. On the 'Enter new password' screen, type any password and intercept the POST /validate-password request.
  4. Change the email field from the attacker's address to the victim's address.
  5. Forward the request and observe a 200 OK response confirming the password change.
  6. Log in as the victim 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 forget your password, a website sends a one-time code to your email to prove you own the account. This report shows that after proving ownership of their own email, an attacker could simply change the email address in the final step to someone else's and reset that person's password. The website trusted the email address sent by the browser instead of checking which account had actually passed the code check.

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.