Skip to content
Account takeover Write-up Beginner

The Curious Case of an Insecure Password Reset Flaw

A password reset token remained valid after the user changed their password, as long as they did not log in with the new password. An attacker who obtained the reset link could use it to compromise the account.

medium.com

Published on medium.com

During our penetration testing journey, we encounter numerous test cases. Recently, I came across a unique scenario that I felt was worth sharing with my readers.

Sapienshack, 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 application only invalidates the reset token upon a successful login with the new password, rather than immediately after the password is changed.

Impact

If an attacker obtains the reset link through phishing or other means, it could lead to account compromise.

What the attacker needed

Attacker obtains reset link; victim changes password but does not log in

The fix

The reset token should be invalidated immediately after the password is updated, not only after login.

How it was found

  1. Request a password reset.
  2. Use the reset link to update the password.
  3. Do not log in with the new password.
  4. Observe that the reset token remains valid.

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 emails you a special link to set a new one. Normally that link should stop working as soon as you use it. Here, the link kept working until you actually logged in with the new password, so anyone who got the link could still use it.

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.