Skip to content
Account takeover Write-up Beginner

I Found a Password Reset Token Flaw in My Bug Bounty Testing , But My Report Was Marked as a…

An older password reset link stayed usable after a newer reset link was requested for the same account, suggesting earlier tokens were not invalidated. An attacker who already held an old reset link could still complete a password change, though the text does not show how such a token would be obtained.

Samadhan shimple Follow

Published on medium.com

Bug Bounty

Samadhan shimple, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

This is an account of testing the password reset functionality of a web application that was within a security testing scope. Password reset is the account recovery feature that lets a user who has forgotten their password request a link by email and use it to set a new password. The report does not name the application, the program, or the platform that hosted the bounty.

The behaviour under test was the token lifecycle: what happens to an outstanding reset link when the same account requests a second one. The researcher's question was simple: What happens to an older reset link when a user requests a new one?

Setup

The testing was carried out on an account the researcher was authorised to test, within the program's scope and rules. No specific tools, versions, roles or headers are described. The evidence collected was a screen recording of the observed behaviour, which was attached to the report. The report does not include the recording, the reset tokens, the email addresses, or any request or response.

Finding it

While testing the password reset flow, the researcher requested more than one reset link for the same account. After a new link had been issued, the older link still appeared to work: it could still complete a password change. That suggested the application was not invalidating earlier reset tokens when it issued a new one.

This looked wrong because a reset token is a bearer credential for the account: anyone holding a valid one can set a new password without knowing the current one. If an old token stays valid after a replacement has been issued, a link that has already been exposed, for example one sitting in an inbox, browser history or another stored location, remains usable for longer than the application presumably intended.

This image is a AI Generated From the original on medium.com

The image at the top of the article is described by the author as AI generated.

Exploitation

The researcher describes the process as understanding the token lifecycle rather than attempting to access another person's account. The steps were:

Step 1: Start a reset for an authorised account

A password reset was initiated for an account the researcher was authorised to test. The report does not show the request or the response.

Step 2: Request a second link before using the first

Before using the first link, a second reset link was requested for the same account. At this point the application had issued two reset links for the same account.

Step 3: Check whether the earlier link is still accepted

The older link was used and it still worked.

Step 4: Verify the password change

The older link was able to complete a password change. This confirmed that the earlier token had not been invalidated by the newer request.

Step 5: Record the result

The behaviour was recorded so it could be explained clearly in the report. The recording was attached to the submission as evidence.

The test stayed focused on the password recovery feature, and the write-up deliberately excludes real reset tokens, private email addresses, session cookies and any unredacted recording containing sensitive information.

Root cause

The observed behaviour is consistent with the application issuing a new reset token without invalidating the outstanding one, so several tokens for the same account can be valid at once.

The report makes the general point that the server has to enforce the token lifecycle. Hiding an old link in the interface, or sending another email, does not invalidate a token.

Impact

A reset token allows a password change without knowledge of the current password. If an old token remains valid longer than intended, it creates additional risk when that token has already been exposed to someone who should no longer be able to use it, for example a link left in an email inbox or browser history.

The report is careful about the limits. An older token remaining valid does not by itself mean an attacker can take over an account: the attacker must also obtain a usable token and satisfy the application's other security requirements. The demonstrated behaviour is that an older reset link could still complete a password change after a newer link had been requested, which is not the same as proving that an unknown attacker could take over another user's account.

Reporting and outcome

The report described the issue, the steps to reproduce it, the expected and actual results, and the potential security impact, with the screen recording attached. The program closed the submission as a duplicate of an earlier report, identified as #2650109. According to the response, the earlier submission had already described the same password reset token issue and the same general testing scenario. The report was therefore not treated as a new vulnerability.

The lesson drawn is that finding a valid issue and being the first to report it are different things, and that duplicates are a normal part of bug bounty programs.

Fix

It sets out what a secure design should do:

  • Generate cryptographically secure, unpredictable reset tokens.
  • Enforce token expiration and single-use behaviour.
  • Invalidate earlier outstanding tokens when a new request is intended to replace them.
  • Ensure a token cannot be reused after a successful password reset.
  • Apply rate limits and monitor suspicious password reset activity.
  • Avoid storing raw reset tokens in application logs.
  • Test token invalidation and expiration as part of security testing.

The report notes that reset-token designs can legitimately differ, so the point is to test the application's intended behaviour and document the actual impact. Where the design intends a new link to replace earlier ones, the server should invalidate the previous outstanding tokens when the new request is processed.

Variants to test

  • Reuse after a successful reset. Complete a password change with a token, then submit the same token again. A positive result is the second submission being accepted or the password being changed again.
  • Expiry boundary. Request a token, wait past the stated lifetime, and submit it. A positive result is acceptance after expiry.
  • Token replacement across sessions. Request one link in one browser session and a second in another, then use the first. A positive result is the first link still completing a reset.
  • Token invalidation on password change. Change the password through the normal logged-in flow and then use an outstanding reset link. A positive result is the link still working.
  • Token invalidation on email change or account state change. Request a reset, then change the account email or lock the account, and submit the old token. A positive result is the token still being honoured.
  • Predictability. Collect several tokens issued close together and compare them for structure, sequence or low entropy. A positive result is a token that can be derived from another.
  • Token in logs or referrers. Check whether the token appears in application logs, analytics, or Referer headers when the reset page loads third-party resources. A positive result is a raw token appearing where it should not.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A security researcher was testing a website's password reset feature. This is the feature you use when you have forgotten your password: you click "forgot password", the site emails you a link, and you click that link to choose a new password.

The researcher noticed something odd. They asked for a reset link, then asked for a second one before using the first. Normally you would expect the first link to stop working once a new one is issued, the same way a shop might cancel your old gift card when it prints you a replacement. Here, the old link still worked: it could still be used to change the password.

They wrote this up carefully, recorded a video of the behaviour, and sent it to the bug bounty program. The program replied that the same issue had already been reported by someone else, and closed the submission as a duplicate. The researcher learned a lot from the experience and wrote about it.

This article walks through that story from the beginning, explaining every term as it comes up. You only need to know how to use a browser.

Background: what a bug bounty program is

Many companies invite outside people to look for security problems in their websites and apps. They publish rules, called a scope, saying which systems you may test and how. If you find a real problem and report it properly, the company may pay you a reward, called a bounty. This arrangement is called a bug bounty program.

A vulnerability is a weakness in a system that could let someone do something they should not be able to do. A bug bounty hunter or security researcher is the person looking for these weaknesses.

One important rule in these programs is responsible disclosure: you report the problem privately to the company, give them time to fix it, and do not publish details that could help someone abuse it. You also only test accounts and data you are allowed to touch.

The feature under test: password reset

When you create an account on a website, the site stores your password so it can check it when you log in. Because people forget passwords, most sites offer a recovery route. You enter your email address, the site sends you a message containing a special link, and clicking that link lets you set a new password.

The special part of that link is a token: a long, random-looking string of characters that acts like a temporary key. Think of a hotel key card. The front desk gives you a card that opens your room, and it stops working when you check out. A reset token works the same way: it proves you are allowed to change the password, but only for a limited time and ideally only once.

A token is a kind of credential, meaning something that proves who you are or what you are allowed to do. Your password is a credential. So is a session cookie, which is a small piece of data your browser stores after you log in so the site remembers you on the next page. A reset token is a credential too, and that is exactly why it matters: anyone who holds a valid one can set a new password without knowing the old one.

The researcher's question was about the token lifecycle, meaning the full life of a token from the moment it is created to the moment it stops working. Specifically: What happens to an older reset link when a user requests a new one?

Setting up the test

The testing was done on an account the researcher was authorised to test, following the program's scope and rules. The report does not name the application, the program, or the platform that hosted the bounty, and it does not describe any particular tools, versions or user roles.

The evidence collected was a screen recording of what happened, which was attached to the report. The report does not include the recording itself, the reset tokens, the email addresses, or any of the network requests and responses.

This image is a AI Generated From the original on medium.com

The image at the top of the article is described by the author as AI generated.

Finding the issue

While testing the password reset flow, the researcher requested more than one reset link for the same account. After a new link had been issued, the older link still appeared to work: it could still complete a password change. That suggested the application was not invalidating earlier reset tokens when it issued a new one.

To invalidate a token means to make it stop working. If a site issues a replacement link, the sensible behaviour is to cancel the old one at the same moment, so only one key is ever live.

Why does this matter? Because a reset token is a bearer credential: whoever holds it can use it. If an old token stays valid after a replacement has been issued, a link that has already been exposed, for example one sitting in an email inbox, browser history or another stored location, remains usable for longer than the application presumably intended.

Walking through the test, step by step

The researcher describes the process as understanding the token lifecycle rather than attempting to access another person's account. The steps were:

Step 1: Start a reset for an authorised account

A password reset was initiated for an account the researcher was authorised to test. The report does not show the request or the response.

Why this step: you need a real, permitted account to observe the feature honestly. Starting the reset is what causes the site to create the first token.

Step 2: Request a second link before using the first

Before using the first link, a second reset link was requested for the same account. At this point the application had issued two reset links for the same account.

Why this step: this is the heart of the test. By asking for a second link while the first is still unused, you create the exact situation where a well-designed site should cancel the first one. If it does not, you will see it in the next step.

Step 3: Check whether the earlier link is still accepted

The older link was used and it still worked.

Why this step: acceptance is the observable evidence. You are not guessing at the site's internal design; you are watching what it actually does when the old link is used.

Step 4: Verify the password change

The older link was able to complete a password change. This confirmed that the earlier token had not been invalidated by the newer request.

Why this step: a link that merely loads a page proves little. A link that actually changes the password proves the token was still honoured as a full credential.

Step 5: Record the result

The behaviour was recorded so it could be explained clearly in the report. The recording was attached to the submission as evidence.

Why this step: a security report is only as strong as its evidence. A recording lets the security team see exactly what you saw and reproduce it themselves.

The test stayed focused on the password recovery feature, and the write-up deliberately excludes real reset tokens, private email addresses, session cookies and any unredacted recording containing sensitive information.

Why the behaviour happens

The observed behaviour is consistent with the application issuing a new reset token without invalidating the outstanding one, so several tokens for the same account can be valid at once.

A useful comparison is a guest list at a venue. If the door staff only check that your name is on the list, and nobody crosses off the old entry when a new one is added, then every copy of the invitation stays valid. The fix is not to hide the old invitation; it is to cross it off at the door.

The report makes the general point that the server has to enforce the token lifecycle. The server is the computer that runs the website and sends pages to your browser. Hiding an old link in the interface, or sending another email, does not invalidate a token.

Impact: how bad is this?

A reset token allows a password change without knowledge of the current password. If an old token remains valid longer than intended, it creates additional risk when that token has already been exposed to someone who should no longer be able to use it, for example a link left in an email inbox or browser history.

The report is careful about the limits. An older token remaining valid does not by itself mean an attacker can take over an account: the attacker must also obtain a usable token and satisfy the application's other security requirements. The demonstrated behaviour is that an older reset link could still complete a password change after a newer link had been requested, which is not the same as proving that an unknown attacker could take over another user's account.

This distinction matters in reporting. Account takeover means an attacker gains full control of someone else's account. Claiming that without proof weakens a report. Stating exactly what you observed, and what would still be needed for a worse outcome, makes the report more credible.

Reporting the issue and the outcome

The report described the issue, the steps to reproduce it, the expected and actual results, and the potential security impact, with the screen recording attached. The program closed the submission as a duplicate of an earlier report, identified as #2650109. According to the response, the earlier submission had already described the same password reset token issue and the same general testing scenario. The report was therefore not treated as a new vulnerability.

A duplicate means someone else reported the same problem first. The lesson drawn is that finding a valid issue and being the first to report it are different things, and that duplicates are a normal part of bug bounty programs.

How developers can prevent this

It sets out what a secure design should do:

  • Generate cryptographically secure, unpredictable reset tokens.
  • Enforce token expiration and single-use behaviour.
  • Invalidate earlier outstanding tokens when a new request is intended to replace them.
  • Ensure a token cannot be reused after a successful password reset.
  • Apply rate limits and monitor suspicious password reset activity.
  • Avoid storing raw reset tokens in application logs.
  • Test token invalidation and expiration as part of security testing.

A few of these terms deserve a plain explanation. Cryptographically secure means generated by a method designed so that nobody can guess the next value; a token made from a predictable pattern, like a counter, is easy to forge. Expiration means the token stops working after a set time. Single-use means it works once and then is dead. A rate limit caps how many requests can be made in a period, which slows down anyone trying many guesses. Logs are the records a system keeps of what happened, and a raw token sitting in a log is a secret sitting in a file that many people may be able to read.

The report notes that reset-token designs can legitimately differ, so the point is to test the application's intended behaviour and document the actual impact. Where the design intends a new link to replace earlier ones, the server should invalidate the previous outstanding tokens when the new request is processed.

Other variations worth testing

Once you understand the idea of a token lifecycle, there are several related situations you can check. Each one asks a slightly different question about when a token should stop working.

  • Reuse after a successful reset. Complete a password change with a token, then submit the same token again. A positive result is the second submission being accepted or the password being changed again.
  • Expiry boundary. Request a token, wait past the stated lifetime, and submit it. A positive result is acceptance after expiry.
  • Token replacement across sessions. Request one link in one browser session and a second in another, then use the first. A positive result is the first link still completing a reset.
  • Token invalidation on password change. Change the password through the normal logged-in flow and then use an outstanding reset link. A positive result is the link still working.
  • Token invalidation on email change or account state change. Request a reset, then change the account email or lock the account, and submit the old token. A positive result is the token still being honoured.
  • Predictability. Collect several tokens issued close together and compare them for structure, sequence or low entropy. A positive result is a token that can be derived from another. Entropy here means randomness: a token with low entropy is easier to guess.
  • Token in logs or referrers. Check whether the token appears in application logs, analytics, or Referer headers when the reset page loads third-party resources. A positive result is a raw token appearing where it should not. The Referer header is a small piece of information your browser sends to a site telling it which page you came from; if a reset link loads images or scripts from another company, that company may learn the link.

Glossary

  • Account takeover: an attacker gaining full control of someone else's account.
  • Bearer credential: a secret that grants access to whoever holds it, with no further proof of identity required.
  • Bug bounty program: a scheme where a company invites outside researchers to find and report security problems, often for a reward.
  • Bounty: the reward a company pays for a valid security report.
  • Credential: something that proves who you are or what you are allowed to do, such as a password or a token.
  • Cryptographically secure: generated in a way that makes the value impossible to predict or guess.
  • Duplicate: a report describing a problem that has already been reported by someone else.
  • Entropy: the amount of randomness in a value; low entropy means easier to guess.
  • Expiration: the point at which a token or credential stops being valid after a set time.
  • Invalidate: to make a token or credential stop working.
  • Logs: records a system keeps of events and requests.
  • Password reset: the account recovery feature that lets a user set a new password after forgetting the old one.
  • Rate limit: a cap on how many requests can be made in a given period.
  • Referer header: information a browser sends to a site about the page you came from.
  • Responsible disclosure: reporting a security problem privately and giving the company time to fix it before details are published.
  • Scope: the rules stating which systems and accounts a researcher is allowed to test.
  • Server: the computer that runs a website and responds to requests from your browser.
  • Session cookie: a small piece of data stored by your browser after you log in so the site remembers you.
  • Single-use: a token that works once and then stops working.
  • Token: a long, random string that acts as a temporary key, proving you are allowed to perform an action.
  • Token lifecycle: the full life of a token, from creation through use to expiry or invalidation.
  • Vulnerability: a weakness in a system that could let someone do something they should not be able to do.

More by Samadhan shimple

View all

7 more disclosed reports, best first.

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.