Skip to content
Business logic Disclosed report Beginner

Improperly implemented password recovery link functionality

The password recovery link logs the user in automatically before they set a new password. An attacker can send their own recovery link to a victim, causing the victim to be logged into the attacker's account.

dawidczagan Follow

Originally disclosed on HackerOne

Bounty$300 View original
  • Triaged in under an hour
  • Fixed in 4 hours
  • Paid in 4 hours
  • Disclosed after 30 days

I took a look at live install of Phabricator (https://secure.phabricator.com/) and noticed, that the user gets automatically logged in after clicking the password recovery link (this link is sent to the user's mail). This authentication takes place before the user is asked to enter a new password twice. This can be used be the attacker to log in a user to the attacker's account - the attacker generates a password recovery link to his account, sends it to the user and the user becomes logged in to the attacker's account, when he clicks the link delivered by the attacker.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is a live installation of Phabricator at https://secure.phabricator.com/. The feature under examination is password recovery: a user who has forgotten their password asks for a recovery link, and that link is delivered to the user's email address.

The researcher noticed that clicking the recovery link logs the user in automatically. This authentication happens before the user is asked to enter a new password twice. In other words, the link does two jobs at once: it proves control of the mailbox and it establishes an authenticated session, and the session exists before the password change step is reached.

The researcher then described how this behaviour can be turned around. The attacker generates a password recovery link for their own account and sends it to the victim. When the victim clicks the link delivered by the attacker, the victim becomes logged in to the attacker's account. The victim is now operating inside an account the attacker controls.

The report gives no HTTP requests, parameters, headers or server responses, and it does not describe a fix, a severity rating or a CVSS score. The disclosed record shows a bounty of 300.00 USD and a weakness classification of improper authentication (generic).

Root cause

The report does not analyse the underlying cause; it records only the observed behaviour. Because the session is issued before the password is actually changed, the link becomes a general login mechanism for whichever account it was generated for, including an account the person clicking it does not own.

The token is generated by the attacker for the attacker's account, but nothing in the flow distinguishes the requester from the clicker, so the clicker is silently logged in as the requester.

Impact

As the report describes it, an attacker can log a victim in to the attacker's account. The report stops at the victim being logged in to the attacker's account. The report does not go beyond this scenario and does not claim account takeover of the victim's own account.

How this kind of bug works

Password recovery flows usually involve a token sent out of band, by email, that proves the requester controls the mailbox associated with an account. The safe design uses that token for exactly one purpose: allowing the holder to set a new password for that account. The dangerous design uses it to establish a session first and ask questions later.

When the token creates a session, the link stops being an authorisation for a password change and becomes a bearer credential for the account. Anyone who can get another person to click such a link can put that person into a chosen account. This is sometimes called login CSRF, because the attacker is forcing a session on the victim rather than stealing one. The victim's subsequent activity happens under the attacker's identity, and any data the victim submits is visible to the attacker.

Defences are straightforward in principle: do not create a session from a recovery token, require the new password to be submitted with the token in the same request, bind the token to the account and to a single use, expire it quickly, and, where the product allows, require the user to confirm their identity again after the reset.

How to test for it

  1. Register two accounts you control, one as the attacker and one as the victim.
  2. Request a password recovery for the attacker account and capture the link from the mailbox.
  3. Open the link in a browser profile that is logged out, or in a private window, and observe whether a session is created before any new password is submitted. Check for session cookies being set and for authenticated pages loading.
  4. If a session appears, note whether it belongs to the attacker account. That is the core signal.
  5. Deliver the same link to the victim account's browser, for example by opening it in a second profile logged in as the victim, and check which account the application now shows.
  6. Repeat with a link that has already been used, and with a link after the password has been changed, to see whether the token is single use and whether it expires.

A positive result is a session established for the token's account without the password change being completed, especially when the person clicking is not the person who requested the link. Common false positives include flows that set a short lived, unauthenticated "reset in progress" cookie rather than a real session, and flows that show the reset form but reject every authenticated action until the password is submitted. Verify by loading an authenticated page, not just by looking for a cookie.

How it is fixed

The recovery link should present a form that accepts the token and the new password together, and only after a successful password change should a session be issued, ideally requiring the user to log in with the new credentials. The token should be bound to the account, single use, and short lived. Applications that must log the user in after a reset should make that session belong to the account whose password was just changed, and should not accept a token generated for a different account.

Hunting notes

Signals worth following during recon include endpoints that accept a token and immediately redirect to a dashboard, links that remain valid after use, and any flow where the password form appears after a session cookie has already been set. Test with two accounts you own so you can see exactly which identity the application assigns.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Phabricator is a web application that teams use to manage software projects. Like most such products, it has user accounts and a password recovery feature: if you forget your password, you ask the site to send you a recovery link by email, and you click that link to set a new password.

The researcher was looking at a live installation of Phabricator at https://secure.phabricator.com/ and noticed something odd about that recovery link. When you click it, the site logs you in automatically. This login happens before you are asked to type a new password twice. So the link does two separate jobs at once: it proves you can read the email inbox, and it also opens a logged-in session for you.

That sounds convenient, but it can be turned against people. Here is the trick the researcher described:

  1. The attacker asks for a password recovery link for their own account.
  2. The attacker sends that link to the victim, for example by email or chat.
  3. The victim clicks the link.
  4. The victim is now logged in to the attacker's account, not their own.

The victim is logged in to an account the attacker controls.

The report does not include any HTTP requests, parameters, headers or server responses, and it does not describe a fix, a severity rating or a CVSS score. The disclosed record shows a bounty of 300.00 USD and a weakness classification of improper authentication (generic).

Why this happens

To understand the mistake, it helps to know what a session is. When you log in to a website, the server gives your browser a small piece of data, usually stored in a cookie, that acts like a wristband at an event. On every later request the browser shows the wristband, and the server knows who you are without asking for your password again. A session cookie is therefore a proof of identity, and whoever holds it is treated as that user.

A recovery token is different. It is a long random string inside the recovery link, and its only legitimate job is to prove that whoever clicked the link can read the account's email inbox. It should authorise one narrow action: setting a new password for that account.

The report records the behaviour without analysing its cause. Instead of saying "this person may change the password", it says "this person is now logged in". Because the session is issued before the password is actually changed, the link becomes a general login mechanism for whichever account it was generated for, even if the person clicking it does not own that account.

The attacker generated the token for the attacker's account, but nothing distinguishes the requester from the clicker, so the clicker is silently logged in as the requester.

In general, how this kind of bug works

Password recovery flows normally rely on a token sent out of band, meaning through a channel other than the website itself, usually email. The safe design uses that token for exactly one purpose: letting the holder set a new password for the account it belongs to. The dangerous design uses it to open a session first and ask questions later.

When a token creates a session, the link stops being permission to change a password and becomes a bearer credential for the account. Think of a cloakroom ticket: whoever holds the ticket gets the coat, no questions asked. Anyone who can get another person to click such a link can put that person into a chosen account.

This pattern is sometimes called login CSRF. CSRF stands for cross-site request forgery: the attacker causes the victim's browser to perform an action the victim did not intend. Here the attacker is not stealing the victim's session, they are forcing a session on the victim. The victim's later activity happens under the attacker's identity, and any data the victim submits is visible to the attacker.

Defences are straightforward in principle: do not create a session from a recovery token, require the new password to be submitted together with the token in the same request, bind the token to the account and to a single use, expire it quickly, and, where the product allows, ask the user to confirm their identity again after the reset.

How to test for it

  1. Register two accounts you control, one as the attacker and one as the victim.
  2. Request a password recovery for the attacker account and capture the link from the mailbox.
  3. Open the link in a browser profile that is logged out, or in a private window, and observe whether a session is created before any new password is submitted. Check for session cookies being set and for authenticated pages loading.
  4. If a session appears, note whether it belongs to the attacker account. That is the core signal.
  5. Deliver the same link to the victim account's browser, for example by opening it in a second profile logged in as the victim, and check which account the application now shows.
  6. Repeat with a link that has already been used, and with a link after the password has been changed, to see whether the token is single use and whether it expires.

A positive result is a session established for the token's account without the password change being completed, especially when the person clicking is not the person who requested the link. Common false positives include flows that set a short lived, unauthenticated "reset in progress" cookie rather than a real session, and flows that show the reset form but reject every authenticated action until the password is submitted. Verify by loading an authenticated page, not just by looking for a cookie.

How it is fixed

The recovery link should present a form that accepts the token and the new password together, and only after a successful password change should a session be issued, ideally requiring the user to log in with the new credentials. The token should be bound to the account, single use, and short lived. Applications that must log the user in after a reset should make that session belong to the account whose password was just changed, and should not accept a token generated for a different account.

Hunting notes

Signals worth following during recon include endpoints that accept a token and immediately redirect to a dashboard, links that remain valid after use, and any flow where the password form appears after a session cookie has already been set. Test with two accounts you own so you can see exactly which identity the application assigns.

Glossary

  • Phabricator: a web application for managing software projects, with user accounts and a password recovery feature.
  • Password recovery link: an email link that lets a user set a new password after forgetting the old one.
  • Session: the state that keeps you logged in after you enter your password, usually represented by a cookie.
  • Cookie: a small piece of data a website stores in your browser and reads back on later requests.
  • Session cookie: a cookie that proves who you are, so the server does not ask for your password on every page.
  • Token: a long random string inside a recovery link that proves the clicker can read the account's email inbox.
  • Authentication: the process of proving who you are, for example by logging in.
  • Authorisation: permission to perform a specific action, such as changing a password.
  • Out of band: sent through a separate channel, such as email, rather than through the website itself.
  • Bearer credential: something that grants access to whoever holds it, like a cloakroom ticket.
  • CSRF (cross-site request forgery): an attack where the attacker makes the victim's browser perform an action the victim did not intend.
  • Login CSRF: a CSRF variant where the attacker forces a session on the victim, logging them in to an account the attacker controls.
  • Account takeover: gaining control of another person's account; the report does not claim this for the victim's own account.
  • Endpoint: a specific address on a website that accepts requests and performs an action.
  • False positive: a test result that looks like a bug but is not one.
  • Recon: the exploratory phase of testing where you look for interesting behaviour.
  • CVSS: a standard scoring system for the severity of a vulnerability; the report gives no score.

More by dawidczagan

View all

9 more disclosed reports, best first.

More from Phabricator

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.