Simple ATO in private program.
The password reset endpoint trusted the X-Forwarded-Host header when building the reset link, so an attacker could point the link at their own domain. When the victim opened the emailed link, the reset token was sent to the attacker, allowing account takeover.
Hello Friend. I’m gonna talk about a simple Account Takeover vulnerability I found in a private program at Bugcrowd so grab your coffee and let’s get started.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the password reset link was generated from the untrusted X-Forwarded-Host header rather than a fixed, configured domain.
Impact
An attacker could steal a victim's password reset token and take over their account.
What the attacker needed
Victim requests a password reset; attacker can intercept the reset request; victim clicks the emailed link
How it was found
- Log out and intercept the password reset request.
- Add X-Forwarded-Host (and other host-like headers) pointing at an attacker-controlled domain.
- Observe a 404; remove headers until X-Forwarded-Host is identified as the cause.
- Retry with the target domain as a prefix of the attacker domain to get a 200 response.
- Receive the reset email containing a link on the attacker domain.
- Open the link and see the reset token sent to the attacker's server.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you forget your password, the site emails you a special link containing a secret token. This site built that link using a value supplied by the requester (a header called X-Forwarded-Host) instead of its own fixed domain. An attacker could make the link point to their own server, so when the victim clicked it the secret token was sent to the attacker, who could then reset the victim's password.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.