Skip to content
Account takeover Write-up Intermediate

Pwn Them All #BugBounty

The password reset endpoint was vulnerable to Host header injection, allowing an attacker to manipulate the reset link sent to victims. An attacker could send a crafted request with a malicious X-Forwarded-Host header, causing the victim's password reset token to be sent to the attacker's server when the victim clicks the link.

Bilal Khan Follow

Published on medium.com

#### Bilal Khan

Bilal Khan, 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.

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 application used the value of the X-Forwarded-Host header to construct the password reset link without validating it against an allowlist.

Impact

An attacker could steal a victim's password reset token and potentially take over their account.

What the attacker needed

Victim clicks the reset link; attacker can send crafted requests

How it was found

  1. Set up a local Python server on port 8080 and ngrok on port 80 to receive requests.
  2. Capture the forgot password request in Burp Suite.
  3. Try various headers such as X-Host, X-Server, X-Forwarded-For, and X-Forwarded-Host with a malicious domain.
  4. Identify that X-Forwarded-Host: evil.com works and the reset link is changed to the attacker's host.
  5. Send the reset email to the victim; when the victim clicks the link, the password reset token is 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, a website sends you an email with a special link to reset it. This link usually contains the website's address. The bug here is that the website trusted a header (a piece of information sent with the request) that told it to use a different address, so the reset link pointed to the attacker's server. When the victim clicked the link, their secret reset token was sent to the attacker, who could then take over the account.

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.

More by Bilal Khan

View all

2 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.