Skip to content
Account takeover Write-up Beginner

Bug Bounty Goldmine — Host Header Attack for Password Rese

The article explains that a web application builds password reset links using the HTTP Host header without validating it. An attacker can send a reset request with a malicious Host header so the victim receives a link pointing to the attacker's server, and when clicked the reset token is captured and used to take over the account.

zoningxtr Follow

Published on medium.com

Disclaimer: This content is foreducational purposes only. The author isnot responsible for any use or misuseof the information provided.

Zoningxtr, 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 constructs absolute password reset URLs directly from the untrusted HTTP Host header without validating it against an allowlist.

Impact

An attacker could capture a victim's password reset token and use it to take over the account, though the attack relies on the victim clicking a link in a phishing email.

What the attacker needed

Victim clicks a link; attacker controls a server; reset email contains absolute URL

The fix

The application should never trust the Host header when generating absolute URLs; it should use a hardcoded trusted domain, validate the Host against an allowlist, or use relative links in reset emails.

How it was found

  1. Go to the forgot password page and enter your email.
  2. Check the reset email for an absolute URL containing a token.
  3. Send the reset request again with the Host header changed to an attacker-controlled domain.
  4. Observe that the reset email now contains a link pointing to the attacker's domain.
  5. Trick the victim into triggering a reset and clicking the poisoned link.
  6. Capture the token on the attacker's server and use it on the real reset page to set a new password.

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 a password, a website emails you a special link containing a secret code (a token) that lets you set a new one. This article shows that if the website builds that link using a value the visitor can control (the Host header, which normally says which website is being requested), an attacker can make the link point to their own server. The victim then clicks the attacker's link, the secret code is sent to the attacker, and the attacker uses it to 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.

More by zoningxtr

View all

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