Skip to content
Account takeover Disclosed report Beginner

All Active user sessions should be deleted when user change his password!

When a user changed or reset their password, existing sessions remained active, so an attacker who already had access to an account would keep that access even after the password was changed. The report led the team to invalidate all sessions on password change or reset.

faisalahmed Follow

Originally disclosed on HackerOne

Bounty$100 View original
  • Triaged in 12 hours
  • Fixed in 4 days
  • Paid in 4 days
  • Disclosed after 24 months

Summary by the program

When a user changed his/her password (either directly or with reset password flow), existing sessions were kept active.

We already invalidate all sessions when a user logs out, but we were not doing the same for password changes. This means that if an attacker were to get access to an account, even if you changed your password, it would not directly disable his/her session (unless you explicitly went to "logout", which is not the most user-intuitive).

As a result of this report, we rethought how we handled password changes, and we decided to invalidate all sessions on a password change/reset to protect from this possible problem.

Summary by the researcher

Existing user sessions wasn't getting destroyed when a HackerOne user changed his password from account panel or through password reset token! HackerOne was aware of this issue, but didn't consider it as an immediate fix as another fix (all active sessions invalidates when user logout from account) was in place. As a result of this report, HackerOne team decided to invalidate all sessions on a password change/reset to protect from this possible problem.

Thanks to HackerOne team for fixing this issue and the bounty!

The original report as published on HackerOne, by faisalahmed. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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. 4 min read.

Context

HackerOne is a bug bounty platform where researchers hold accounts and manage their reports, payouts and profile settings. Like most account-based services, it offers a password change from the account panel and a password reset flow driven by a reset token. Both flows are meant to let a user replace their credential and, in doing so, take back control of the account.

The report is about session lifecycle around those two flows. HackerOne already invalidated all active sessions when a user logged out, but it did not do the same when the password was changed or reset. The researcher's title states the expectation plainly: all active user sessions should be deleted when a user changes their password.

Setup

The report does not describe any special tooling, versions or test accounts. The precondition is simply a HackerOne account with at least one active session, plus the ability to change the password either from the account panel or through the password reset token flow. The behaviour under test is whether other sessions belonging to the same account survive that change.

Finding it

The researcher noticed that existing user sessions were not destroyed when a HackerOne user changed their password, whether from the account panel or through the password reset token. The account's credential changed, but sessions established before the change kept working.

This looked wrong because a password change is the natural recovery action after a suspected compromise. If old sessions outlive the new password, the person who changed it cannot be sure they are the only one in the account.

HackerOne was aware of the issue but did not treat it as an immediate fix, because another fix was already in place: all active sessions were invalidated when the user logged out of the account. The gap was that this invalidation was tied to logout only, not to password change or reset.

Exploitation

Step 1: Establish a session

Log in to HackerOne and keep the resulting session active. This is the session that will be tested for survival.

Step 2: Change the password

Change the password for the same account, either directly from the account panel or by going through the password reset flow with the reset token.

Step 3: Reuse the old session

The session from step 1 is still valid after the password change. The report does not include the individual HTTP requests or responses for these steps, so there is nothing further to reproduce at the protocol level; the observable result is that the pre-change session continues to work.

Step 4: Compare with logout

Logging out does invalidate all active sessions. The difference between the two flows is the whole finding: logout clears sessions, password change and reset do not.

Root cause

The design tied session invalidation to the logout action rather than to the credential change. Password change and password reset updated the stored password but left the session store untouched, so sessions created before the change remained authorised. The existing defence, invalidating all sessions on logout, did not cover this path because it was only wired into logout. The report does not describe the implementation.

Impact

If an attacker gained access to an account, changing the password would not directly disable the attacker's session. The legitimate user would have to explicitly go to logout, which the program notes is not the most user-intuitive step. Until then, the attacker keeps whatever access the existing session grants, even though the password has been replaced. The report frames this as a possible problem rather than describing a specific compromise, and the program's own summary treats it the same way.

Fix

As a result of the report, HackerOne rethought how it handled password changes and decided to invalidate all sessions on a password change or reset. This was an actual change made by the program, not a recommendation left open.

Variants to test

  1. Change the password from the account settings panel while a second session is open elsewhere. A positive result is that the second session is rejected on its next request.
  2. Complete the password reset flow with the reset token while an old session is open. A positive result is that the old session stops working once the reset completes.
  3. Log out in one session and check the others. A positive result here is expected behaviour and serves as a control: if logout clears sessions but password change does not, the gap is confirmed.

Hunting notes

This kind of bug hides in account security flows: password change, password reset, email change and any other action that alters how a user authenticates. The program rethought how it handled password changes and decided to invalidate all sessions on a password change or reset.

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. 9 min read.

What happened, in plain words

HackerOne is a website where security researchers keep accounts. On that account they manage the bug reports they submit, the money they are paid for them, and their profile settings. Like most websites with accounts, HackerOne lets you change your password in two ways: from the account settings page, or through a "forgot password" style reset flow that sends you a special link or code.

When you log in to a website, the site usually gives your browser a small piece of data that it keeps sending back on every request. That piece of data is what tells the site "this is still the same logged-in person". It is called a session. If someone else copies that piece of data, they can act as you without knowing your password.

The researcher found that when you changed your password on HackerOne, the old sessions stayed alive. So if an attacker had already got into your account and had a working session, changing your password did not kick them out. HackerOne already had a fix that killed all sessions when you logged out, but that fix was not applied to password changes or password resets. After this report, HackerOne changed the behaviour so that a password change or reset now invalidates all sessions.

Context

HackerOne is a bug bounty platform. A bug bounty platform is a website where companies pay independent researchers for finding security problems in their software. Researchers hold accounts there and use them to manage their reports, their payouts and their profile settings.

Like most account-based services, HackerOne offers two ways to replace a password:

  1. A password change from the account panel, meaning you are already logged in and you type a new password into a settings page.
  2. A password reset flow driven by a reset token. A token here is a long random string that proves you are allowed to do something, in this case set a new password. It is usually delivered by email so that only the person who controls the mailbox can use it.

Both flows are meant to let a user replace their credential and, in doing so, take back control of the account. A credential is simply the thing you use to prove who you are, and for most sites that is your password.

The report is about the session lifecycle around those two flows. "Session lifecycle" means the whole story of a session: when it is created, how long it lives, and when it is destroyed. HackerOne already invalidated all active sessions when a user logged out, but it did not do the same when the password was changed or reset. The researcher's title states the expectation plainly: all active user sessions should be deleted when a user changes their password.

Setup

The report does not describe any special tooling, versions or test accounts. The precondition is simply a HackerOne account with at least one active session, plus the ability to change the password either from the account panel or through the password reset token flow. The behaviour under test is whether other sessions belonging to the same account survive that change.

In everyday terms: you need to be logged in, and you need to be able to change your own password. Nothing more. The question being asked is simple: after I change my password, does the browser session I was already using still work?

Finding it

The researcher noticed that existing user sessions were not destroyed when a HackerOne user changed their password, whether from the account panel or through the password reset token. The account's credential changed, but sessions established before the change kept working.

This looked wrong because a password change is the natural recovery action after a suspected compromise. If you think someone has got into your account, the first thing you do is change the password, expecting that to lock them out. If old sessions outlive the new password, the person who changed it cannot be sure they are the only one in the account.

A useful comparison: imagine changing the locks on your front door but leaving copies of the old key with everyone who already had one. The lock is new, but the people who had access still get in.

HackerOne was aware of the issue but did not treat it as an immediate fix, because another fix was already in place: all active sessions were invalidated when the user logged out of the account. The gap was that this invalidation was tied to logout only, not to password change or reset.

Exploitation

Step 1: Establish a session

Log in to HackerOne and keep the resulting session active. This is the session that will be tested for survival.

Why this step: you need a session that exists before the password change, so that you can check afterwards whether it still works. If you had no session to begin with, there would be nothing to test.

Step 2: Change the password

Change the password for the same account, either directly from the account panel or by going through the password reset flow with the reset token.

Why this step: this is the action that should, in a well-designed system, invalidate every session for that account.

Step 3: Reuse the old session

The session from step 1 is still valid after the password change. The report does not include the individual HTTP requests or responses for these steps, so there is nothing further to reproduce at the protocol level; the observable result is that the pre-change session continues to work.

Why this step: this is the actual test. If the old session still loads your account pages after the password change, the session was never destroyed. The report does not show the raw requests and responses, so there is no code to copy here; the result is simply that the old session keeps working.

Step 4: Compare with logout

Logging out does invalidate all active sessions. The difference between the two flows is the whole finding: logout clears sessions, password change and reset do not.

Why this step: comparing two behaviours side by side makes the bug obvious. Logout proves the site already knows how to kill sessions. Password change proves that same cleanup was not wired into the password flows. That contrast is what makes the finding easy to understand and hard to argue with.

Root cause

The design tied session invalidation to the logout action rather than to the credential change. Password change and password reset updated the stored password but left the session store untouched, so sessions created before the change remained authorised. The existing defence, invalidating all sessions on logout, did not cover this path because it was only wired into logout.

In plain words: the site had a working "delete all sessions" function, but only the logout button called it. The password change page and the password reset page did not call it. So the password was updated, but the list of live sessions was never touched.

Impact

If an attacker gained access to an account, changing the password would not directly disable the attacker's session. The legitimate user would have to explicitly go to logout, which the program notes is not the most user-intuitive step. Until then, the attacker keeps whatever access the existing session grants, even though the password has been replaced. The report frames this as a possible problem rather than describing a specific compromise, and the program's own summary treats it the same way.

"Not the most user-intuitive" means it is not the step a normal person would think of. Most people assume changing the password is enough. They would not know they also need to press logout on every device.

Fix

As a result of the report, HackerOne rethought how it handled password changes and decided to invalidate all sessions on a password change or reset. This was an actual change made by the program, not a recommendation left open.

Variants to test

These are follow-up checks in the same spirit, for anyone testing a similar site:

  1. Change the password from the account settings panel while a second session is open elsewhere. A positive result is that the second session is rejected on its next request.
  2. Complete the password reset flow with the reset token while an old session is open. A positive result is that the old session stops working once the reset completes.
  3. Log out in one session and check the others. A positive result here is expected behaviour and serves as a control: if logout clears sessions but password change does not, the gap is confirmed.

A "control" in testing means a case where you already know the correct answer. It shows your test method is sound before you trust it on the case you are unsure about.

Hunting notes

This kind of bug hides in account security flows: password change, password reset, email change and any other action that alters how a user authenticates. The program rethought how it handled password changes and decided to invalidate all sessions on a password change or reset.

"Recon" means the early looking-around phase, before you try anything clever. "Account takeover" means someone else getting control of your account. "Session store" means the place on the server where the site keeps track of which sessions are still valid.

Glossary

  • API: a way for one piece of software to talk to another, usually over the web, by sending requests and getting responses back.
  • Account panel: the settings pages of a website where a logged-in user manages their own account.
  • Account takeover: a situation where someone other than the owner gains control of an account.
  • Active session: a session that is still valid and can still be used to access the account.
  • Authorised: allowed to do something, in this case allowed to access the account.
  • Bug bounty platform: a website where companies pay researchers for finding security problems in their software.
  • Control (in testing): a test case where the correct result is already known, used to check that your method works.
  • Credential: the thing you use to prove who you are, such as a password.
  • Exploitation: actually carrying out an attack or test to show that a weakness can be used.
  • HTTP request: a message a browser sends to a server asking for something, such as a page or an action.
  • HTTP response: the message the server sends back.
  • Impact: the real-world harm a weakness could cause.
  • Invalidate: to make something no longer valid, so it stops working.
  • Logout: the action of ending your session on a site.
  • Password reset flow: the process of setting a new password when you are not logged in, usually proven by a token sent to your email.
  • Protocol level: the low-level detail of the messages exchanged between browser and server.
  • Recon: the early phase of looking around a target to understand how it works.
  • Reset token: a long random string that proves you are allowed to reset a password.
  • Root cause: the underlying reason a bug exists, as opposed to its visible symptom.
  • Session: the state of being logged in, represented by a piece of data the browser sends with each request.
  • Session invalidation: destroying sessions so they can no longer be used.
  • Session lifecycle: the full story of a session, from creation to destruction.
  • Session store: the place on the server that keeps track of which sessions are valid.
  • Token: a piece of data used to prove identity or permission.
  • Vulnerability class: a category of security weakness, grouping bugs that share the same underlying mistake.
  • Violation of secure design principles: a weakness where the design of a feature, rather than a coding slip, leaves a security gap.

More by faisalahmed

View all

16 more disclosed reports, best first.

More from HackerOne

View all

The newest disclosed reports for this program.

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.