Skip to content
Account takeover Disclosed report Beginner

Weak Forgot Password implementation

The password reset process did not invalidate existing sessions, so an attacker who had compromised a session could continue using it even after the victim reset their password. The report also notes that the current session was not invalidated after a successful password reset.

pavanw3b Follow

Originally disclosed on HackerOne

  • Triaged in 9 days
  • Fixed in 2 months
  • Disclosed after 10 months

"Cricetinae" :)

###Short Description The Forgot Password is missing a several industry best practices. I strongly believe due to the level of the access given after a successful exploitation, the implementation could have been better.

###Vulnerability Details Referring to OWASP Standards and guidelines [https://www.owasp.org/index.php/Forgot_Password_Cheat_Sheet], I see the following risks in the Forgot Password implementation:

  • Invalidate or provide an option to invalidate existing sessions after password has been reset
  • Invalidate the current session and redirect to login after successful password reset.

Also consider:

  • Do not allow the old the password as the new one.
  • Provide an option to set up Security Questions for admin accounts.

I'm not sure about the above two points as they sound more like features rather than bugs.

Steps to Reproduce

  • Login as a admin on Browser A & keep it.
  • Open Browser B (or incognito/private). Go to Password Recovery page by clicking Forgot your password? from the login page.
  • Note the sessionID cookie. Enter the email address and Proceed >.
  • Open the reset link received by email on Browser B. Note that the sessionID remained the same. Change the password. Note that the user have logged to dashboard without invalidating the current session and the sessionID remained the same.
  • Come back to Browser A and note that the user session is still valid.

Attack vector

  • Invalidating other existing session: The sessionID cookie which drives everything about user accounts, is set to expire on Session which means until the user explicitly clicks the Logout or the browser/tab is closed. Thus if an attacker some how (phishing or brute force) compromised an user account, the hacked session remained the same even though the account owner resets the password or change the email address.
  • Invalidating the current session after the password recovery: Attacker with physical access to the user's computer, leaves the Revive Adserver login page open by noting down the sessionID. User comes, resets the password and logged in. As the attacker knows the sessionID, he can use that in logging in as the user. This works even the attacker not having admin access on the system to install a keylogger and valid until the user logs out and the session is destroyed.

Test Environment Details

Version: Latest as on Oct 16: revive-adserver-4.0.0 downloaded from the official source Setup type: local Browser: Firefox 47.0 OS: Mac OS X

Cheers, Pavan

The original report as published on HackerOne, by pavanw3b. 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. 5 min read.

Context

Revive Adserver is an open source ad server, and this report concerns its password recovery flow, the "Forgot your password?" link on the login page. Normally that flow lets a user who has lost their password request a reset link by email, open the link, choose a new password and get back into the application. The report argues that the implementation of that flow is missing several industry best practices, and that given the level of access a successful login grants, the implementation could have been better.

The researcher measured the flow against the OWASP Forgot Password Cheat Sheet (https://www.owasp.org/index.php/Forgot_Password_Cheat_Sheet) and identified two risks:

  1. Existing sessions are not invalidated, and there is no option to invalidate them, after the password has been reset.
  2. The current session is not invalidated and the user is not redirected to login after a successful password reset.

Two further points were raised as considerations rather than confirmed bugs: not allowing the old password to be reused as the new one, and providing an option to set up security questions for admin accounts. The researcher explicitly said he was not sure about these two, as they sound more like features than bugs.

Setup

The test environment was a local installation of revive-adserver-4.0.0, described as the latest version as of 16 October, downloaded from the official source. Testing was done in Firefox 47.0 on Mac OS X. The reproduction requires an admin account and two browsers: one that stays logged in, and a second one (or a private/incognito window) used for the recovery flow. An email address that can receive the reset link is also needed.

Finding it

The report describes the sessionID cookie as driving everything about user accounts and notes that it is set to expire on Session. That means it lives until the user explicitly clicks Logout or closes the browser or tab. Nothing in the reset flow changes that cookie: not opening the reset link, not changing the password, and not being logged in afterwards. The same session identifier survives the whole password reset, and any other session opened earlier stays valid too.

Exploitation

Step 1: establish a session in the first browser

Log in as an admin in Browser A and leave it logged in. This session is the one that will later be checked for validity.

Step 2: start recovery in a second browser

Open Browser B (or an incognito/private window) and go to the Password Recovery page by clicking Forgot your password? from the login page. Note the sessionID cookie, enter the email address and select Proceed >.

Step 3: reset the password and watch the session

Open the reset link received by email in Browser B. The sessionID remains the same. Change the password. The user is logged in to the dashboard without the current session being invalidated, and the sessionID still remains the same.

Step 4: check the first browser

Return to Browser A. The user session there is still valid.

Root cause

The sessionID cookie is not changed when the password is reset, and other sessions stay valid. The reset flow neither invalidates the current session nor redirects to login after a successful reset, and it offers no way to invalidate other existing sessions. Because the cookie expires only on Session, meaning until an explicit Logout or until the browser or tab is closed, a session established before the reset keeps working afterwards. The report describes the behaviour rather than the code, so the exact implementation mistake is not shown.

Impact

The researcher describes two attack vectors.

Invalidating other existing sessions. The sessionID cookie drives everything about user accounts and is set to expire on Session. If an attacker somehow compromises an account, for example through phishing or brute force, the hijacked session remains the same even though the account owner resets the password or changes the email address. A password reset therefore does not evict the attacker.

Invalidating the current session after password recovery. An attacker with physical access to the user's computer leaves the Revive Adserver login page open and notes down the sessionID. The user then resets the password and logs in. Because the attacker knows the sessionID, they can use it to log in as the user. This works even without admin access on the system to install a keylogger, and it remains valid until the user logs out and the session is destroyed.

The report is rated low severity and does not claim a direct compromise on its own: both vectors depend on the attacker having already obtained the session identifier, through account compromise, phishing, brute force or physical access.

Fix

The report does not describe a fix or a change made in response. Based on the OWASP guidance it cites, the flow should invalidate existing sessions, or offer an option to do so, after a password reset, and should invalidate the current session and redirect to login after a successful reset. The two further suggestions, rejecting the old password as the new one and offering security questions for admin accounts, were raised by the researcher as possible features rather than confirmed defects.

Variants to test

  1. Session rotation on password change. Log in in one browser, reset the password from another, then reload the first browser. A positive result is that the first session is still authenticated.
  2. Session rotation on email change. Change the account email address and check whether other sessions survive.
  3. Reset link handling. Open the reset link and compare the sessionID before and after submitting the new password. A positive result is an unchanged identifier and an immediate login to the dashboard instead of a redirect to the login page.
  4. Old password reuse. Set the new password to the old one and see whether it is accepted.
  5. Cookie lifetime. Inspect the sessionID cookie expiry. A positive result is a session cookie that persists until explicit logout or browser close, with no server-side invalidation on credential change.
  6. Admin security questions. Check whether admin accounts can configure security questions.

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

Revive Adserver is a piece of software that websites use to show adverts. It is open source, which means anyone can download the code and run it themselves. To use it, a person logs in with an email address and a password, just like logging in to an email account or a social network.

This report is about one small part of that login system: the "Forgot your password?" link. When you forget your password, you click that link, type your email address, and the site emails you a special link. You open that link, choose a new password, and you are back in. That is the normal, intended behaviour, and it is what most websites do.

The researcher, pavanw3b, looked at how Revive Adserver handles that recovery flow and compared it with a well-known checklist of good practice published by OWASP (a non-profit that publishes free security guidance). He found that the flow leaves some things undone. The most important one: when you change your password, the software does not throw out the old "logged in" state. If someone else was already logged in as you, or had copied the little piece of data that proves you are logged in, they stay logged in even after you change your password. Changing your password is supposed to be the thing you do when you think someone else has got in. Here, it does not push them out.

The report is rated low severity. That is because the two attack scenarios it describes both need the attacker to have already got hold of that little piece of data somehow, for example by tricking the user, guessing the password, or having physical access to the computer. The report does not claim that anyone can break in from scratch.

Background you need first

A few ideas come up again and again in this report. Here they are from zero.

What an ad server is. A website that shows adverts needs something to decide which advert to show, to whom, and to count how many times it was shown. Revive Adserver does that job. It has an admin area where the people running the adverts log in to set things up.

What a session is. When you log in to a website, the website's server needs a way to remember that you are the person making the next request. The web was not built to remember anything between requests, so websites hand your browser a small label the first time you log in, and your browser shows that label on every request afterwards. That label is called a session identifier. Think of a coat check: you hand in your coat, you get a numbered ticket, and every time you come back you show the ticket to get your coat. The ticket is not your coat, and it is not your name; it is just the number that proves the coat is yours.

What a cookie is. A cookie is a small piece of text that a website asks your browser to store and to send back on later requests to the same site. The session identifier is usually kept in a cookie. In this report the cookie is called sessionID.

What "expire on Session" means. Cookies can have an expiry date, or they can be "session cookies". A session cookie lives only as long as the browser window or tab is open. Close the browser and it is gone. The report says the sessionID cookie is set to expire on Session, which means it survives until the user clicks Logout or closes the browser or tab. It does not quietly time out on its own.

What "invalidating a session" means. Invalidating a session means telling the server "that ticket number is no longer valid, ignore it from now on". The browser may still hold the cookie, but the server refuses to accept it. This is the missing step in the report: after a password reset, the old tickets should stop working.

What OWASP is. OWASP (the Open Worldwide Application Security Project) publishes free, public guidance on how to build secure web applications. One of its pages is a "Forgot Password Cheat Sheet", a checklist of things a password recovery flow should do. The researcher used that checklist as the yardstick.

What "severity" means. Security reports are often given a severity rating (low, medium, high, critical) to say how much damage the issue could cause and how hard it is to exploit. Low means the issue is real but limited, often because it needs other things to go wrong first.

The two problems the researcher found

Measured against the OWASP checklist, the report lists two risks in the Revive Adserver password recovery flow:

  1. Existing sessions are not invalidated, and there is no option to invalidate them, after the password has been reset.
  2. The current session is not invalidated and the user is not redirected to login after a successful password reset.

In plain words: when you finish resetting your password, the software should make all the old "logged in" tickets stop working, including the one you are using right now, and send you back to the login page to sign in fresh. Revive Adserver does neither.

The report also raises two further points, but the researcher is careful to say he is not sure they are bugs:

  • Do not allow the old password to be used as the new one.
  • Provide an option to set up security questions for admin accounts.

He describes these as sounding "more like features rather than bugs". A feature is a piece of functionality that was never built; a bug is something that was built but works wrongly. The distinction matters because it changes what the fix looks like.

The test setup

The researcher tested on a local installation, meaning the software was running on his own machine rather than on a public website. The version was revive-adserver-4.0.0, described as the latest as of 16 October, downloaded from the official source. He used Firefox 47.0 on Mac OS X.

To reproduce the issue you need three things:

  • An admin account on the Revive Adserver installation.
  • Two browsers, or one browser plus a private/incognito window. A private window is a separate browsing space that does not share cookies with the normal window, which is exactly what you need to hold two independent sessions at once.
  • An email address that can receive the reset link.

How the researcher found it

The report describes the sessionID cookie as driving everything about user accounts and notes that it is set to expire on Session. The report describes that cookie as driving everything about user accounts, and notes that it is set to expire on Session. Nothing in the reset flow changes it: not opening the reset link, not choosing a new password, and not being logged in afterwards. The same session identifier survives the whole password reset, and any other session opened earlier stays valid too.

That is the whole finding in one sentence: the ticket number never changes, and old tickets are never cancelled.

Reproducing it, step by step

Step 1: log in and leave the first browser open

Log in as an admin in Browser A and leave it logged in. The point of this step is to create a session that you can later check. If the software behaved correctly, this session would be dead by the end of the test. If it behaves as the report says, it will still be alive.

Step 2: start the recovery flow in a second browser

Open Browser B, or an incognito/private window, and go to the Password Recovery page by clicking Forgot your password? from the login page. Note the sessionID cookie, enter the email address and select Proceed >.

Why a second browser? Because you need two independent sessions at the same time: one that stays logged in, and one that goes through the reset. If you used the same browser for both, you would only have one session and could not compare.

Why note the sessionID? Because the whole test is about whether that value changes. Writing it down before the reset gives you something to compare against afterwards. In Firefox you can see cookies in the developer tools, under the storage or cookies panel for the site.

Step 3: open the reset link and change the password

Open the reset link received by email in Browser B. The sessionID remains the same. Change the password. The user is logged in to the dashboard without the current session being invalidated, and the sessionID still remains the same.

This is the core observation. Two things should have happened and did not:

  • The session identifier should have changed, so that anyone holding the old value would be locked out.
  • The user should have been sent back to the login page to sign in again with the new password, rather than dropped straight into the dashboard.

Step 4: go back to the first browser

Return to Browser A. The user session there is still valid.

This is the consequence. The session created before the password change is still accepted by the server. The password changed, but the proof of being logged in did not.

Why it happens

The sessionID cookie is not changed when the password is reset, and other sessions stay valid. "Rotated" means replaced with a new value; "destroyed" means cancelled on the server side. The reset flow neither invalidates the current session nor redirects to login after a successful reset, and it offers no way to invalidate other existing sessions. Because the cookie expires only on Session, meaning until an explicit Logout or until the browser or tab is closed, a session established before the reset keeps working afterwards.

The report describes the behaviour rather than the code, so the exact implementation mistake is not shown. In other words, we know what the software does; the report does not show us the lines of code that cause it.

What an attacker could do with it

The researcher describes two attack vectors. An attack vector is simply the route an attacker takes to make use of a weakness.

Invalidating other existing sessions. The sessionID cookie drives everything about user accounts and is set to expire on Session. If an attacker somehow compromises an account, for example through phishing or brute force, the hijacked session remains the same even though the account owner resets the password or changes the email address. A password reset therefore does not evict the attacker.

Phishing means tricking someone into handing over their login details, usually with a fake login page. Brute force means trying many passwords quickly until one works. In both cases the attacker ends up with a working session. The normal advice to a victim is "change your password". Here, changing the password does not help, because the attacker's session keeps working.

Invalidating the current session after password recovery. An attacker with physical access to the user's computer leaves the Revive Adserver login page open and notes down the sessionID. The user then resets the password and logs in. Because the attacker knows the sessionID, they can use it to log in as the user. This works even without admin access on the system to install a keylogger, and it remains valid until the user logs out and the session is destroyed.

A keylogger is a program that records every key you press, including passwords. The point here is that the attacker does not need one: they only need to read the cookie value once, while the browser is open. That is a much lower bar.

The report is rated low severity and does not claim a direct compromise on its own: both vectors depend on the attacker having already obtained the session identifier, through account compromise, phishing, brute force or physical access.

What the fix should look like

The report does not describe a fix or a change made in response. Based on the OWASP guidance it cites, the flow should invalidate existing sessions, or offer an option to do so, after a password reset, and should invalidate the current session and redirect to login after a successful reset. The two further suggestions, rejecting the old password as the new one and offering security questions for admin accounts, were raised by the researcher as possible features rather than confirmed defects.

Things to try yourself

If you want to see the behaviour for yourself, these are the checks the report points to. Each one is a small experiment with a clear "this is what wrong looks like" answer.

  1. Session rotation on password change. Log in in one browser, reset the password from another, then reload the first browser. A positive result is that the first session is still authenticated.
  2. Session rotation on email change. Change the account email address and check whether other sessions survive.
  3. Reset link handling. Open the reset link and compare the sessionID before and after submitting the new password. A positive result is an unchanged identifier and an immediate login to the dashboard instead of a redirect to the login page.
  4. Old password reuse. Set the new password to the old one and see whether it is accepted.
  5. Cookie lifetime. Inspect the sessionID cookie expiry. A positive result is a session cookie that persists until explicit logout or browser close, with no server-side invalidation on credential change.
  6. Admin security questions. Check whether admin accounts can configure security questions.

A "positive result" here means the test confirmed the weakness, not that the software did the right thing. That phrasing can be confusing at first: in security testing, a positive result is one where the problem shows up.

Glossary

  • Ad server: software that decides which advert to show on a website, to whom, and counts how often it was shown. Revive Adserver is one.
  • Admin account: a user account with permission to change the settings of the whole installation, not just its own profile.
  • Attack vector: the route an attacker takes to make use of a weakness.
  • Brute force: trying many passwords or guesses quickly until one works.
  • Bug: something that was built but works incorrectly.
  • Cookie: a small piece of text a website asks your browser to store and send back on later requests to the same site.
  • Feature: a piece of functionality that was intended but never built.
  • Incognito/private window: a separate browser window that does not share cookies or history with the normal window, useful for holding two independent sessions at once.
  • Invalidate a session: tell the server that a session identifier is no longer valid, so it is refused even if the browser still holds it.
  • Keylogger: a program that records every key pressed on a computer, including passwords.
  • Local installation: the software running on your own machine rather than on a public website.
  • Low severity: a rating meaning the issue is real but limited, often because other things must go wrong first.
  • Open source: software whose code is publicly available for anyone to download, inspect and run.
  • OWASP: a non-profit that publishes free, public guidance on building secure web applications, including a Forgot Password Cheat Sheet.
  • Password recovery flow: the sequence of pages and emails that lets a user who has forgotten their password choose a new one.
  • Phishing: tricking someone into handing over their login details, usually with a fake login page.
  • Rotate a session identifier: replace the old session identifier with a new one, so anyone holding the old value is locked out.
  • Session: the state of being logged in, remembered by the server across many requests.
  • Session cookie: a cookie with no fixed expiry date that lives only until the browser or tab is closed, or until the user logs out.
  • Session identifier: the value, usually stored in a cookie, that proves to the server which logged-in user is making a request. In this report it is the sessionID cookie.
  • Severity: a rating (low, medium, high, critical) of how much damage an issue could cause and how hard it is to exploit.
  • sessionID: the name of the cookie Revive Adserver uses to carry the session identifier.
  • Two-factor or security questions: extra questions or checks used at login beyond the password. The report mentions security questions for admin accounts as a possible addition.

More by pavanw3b

View all

8 more disclosed reports, best first.

More from Revive Adserver

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.