Skip to content
Account takeover Write-up Intermediate

$9,600 for Trusting a Header the Client Writes: Password Reset Poisoning via Host Header Injection

The password reset link's domain was built from the client-supplied Host header without validation, so an attacker could make reset emails point to their own domain. If a victim clicked the poisoned link, the attacker could capture the reset token and take over the account.

T4nv1 Follow

Published on medium.com

The Host header exists so a single server can host multiple domains and know which one a given request is actually for. It's also, structurally, just another header the client sends — fully attacker-controlled, in the same way any other request header is, even though applications routinely treat it with a level of…

T4nv1, 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

The password reset email generation constructs the reset link’s domain using the incoming request’s Host header without validating it against an allowlist of legitimate application domains.

Impact

An attacker who knows a victim's email address could trigger a poisoned reset email and, if the victim clicks the link, capture the token and take over the account; the report notes this requires the victim to click.

What the attacker needed

Attacker knows victim's email address; victim clicks the poisoned link

The fix

The link generation was fixed to use a fixed, server-configured domain instead of the Host header.

How it was found

  1. Intercept a password reset request and inspect the reset link in the resulting email.
  2. Send a password reset request with a modified Host header pointing to an attacker-controlled domain.
  3. Observe that the reset email contains a link to the attacker-controlled domain with the reset token.
  4. Trigger a reset for a victim's email with the Host header set to the attacker's domain.
  5. Have the victim click the poisoned link, which sends the token to the attacker's server.
  6. Use the captured token against the real reset endpoint to reset the victim's 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 your password, a website emails you a special link to reset it. This site built that link using a value the visitor's browser sends, called the Host header, which tells the server which website name was requested. Because the site trusted that value, an attacker could make the link point to their own website and steal the reset token when the victim clicked it.

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 T4nv1

View all

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