Skip to content
Account takeover Write-up Beginner

Exploiting Password Reset Link After Email Change

A password reset link sent to an old email address stayed valid after the account's email was changed, so anyone holding that link could still set a new password. This let the holder take over the account even though the address on file had moved on.

medium.com

Published on medium.com

I’m happy to share my first bug in an external bug bounty program. This discovery highlights a high issue in how password reset links and email changes were managed.

Abdelrahman Sayed, 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 reset token was only tied to the account rather than to the email address it was issued for, and it was not invalidated when the email was changed.

Impact

An attacker who can read the old inbox, or who already holds the reset link, could reset the password and take over the account, locking out the legitimate user.

What the attacker needed

Access to the old email inbox; a reset link requested before the email change

The fix

The reset token should be invalidated whenever the account email changes, and reset links should expire after a short period.

How it was found

  1. Create an account with one email address and log out.
  2. Request a password reset for that address but do not click the link.
  3. Log back in with the original credentials and change the account email to a different address.
  4. Open the earlier reset email and click its link.
  5. Set a new password and gain control of the account.

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 emails you a special link that lets you set a new one. Normally that link should stop working once the account's email address changes, because the old inbox may no longer belong to the real owner. Here it kept working, so whoever still had the old email could reset the password and get into the 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.