CWE-640Identity & accessSeverity · High

Reset links that keep working

A password reset link still works after use, never expires or survives a newer reset. Anyone who gets an old link from email or logs can take over the account.

At a glance

Controls
CWE-640 · A07:2021 Identification and Authentication Failures
Typical severityHigh
ReferenceCWE-640
OWASP Top 10A07:2021 Identification and Authentication Failures

What it is

A reset link holds a token that lets the holder set a new password. It should work once, for a short time, and only for one account. Weak flows let the token be reused, keep it valid for days, or leave old tokens live after a new one is sent.

An attacker finds an old reset link in a forwarded email, a shared inbox, browser history or a log file. They use it to set a new password and lock out the owner. AI-assisted attackers test token reuse, expiry and account binding in one automated pass.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • The reset confirm endpoint that accepts the token and new password
  • Tokens stored without a used flag or expiry time
  • Reset tokens that can be swapped onto a different email or user ID in the request
  • Logs or analytics that record full reset URLs

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Read the code to see how reset tokens are created, stored, expired and cleared.
  2. 02Request a reset for a test account, use the link once, then try the same link again.
  3. 03Request two resets for the test account and try the first link after the second one is issued.
The rule, in plain English

A reset token must work once, for a short time, for one account.

Executable check

as test user: use reset token T once use reset token T again expect: rejected use a token older than the expiry time expect: rejected

Every rule MATT holds →

What the fix looks like

  1. 01

    Store each token hashed, with a short expiry and a used flag, and mark it used on success.

  2. 02

    Cancel every older token for the account when a new one is issued or the password changes.

  3. 03

    Bind the token to one account on the server and ignore any user ID sent with it.

  4. 04

    End existing sessions after a successful reset.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02