$1000 Bounty: Account Takeover via Host Header Injection in Passw
The password reset flow generated the reset link using the client-supplied Host header without validation. An attacker could change the Host header to their own domain so the victim's reset email contained a link to the attacker's server, leaking the reset token and allowing account takeover.
Published on infosecwriteups.com
Free Article Link: Click for free!
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 application trusted the client-supplied Host header when constructing the password reset URL, without validating or whitelisting the domain.
Impact
An attacker could take over any user's account with minimal user interaction (one click) by leaking the password reset token.
What the attacker needed
Victim clicks a link; attacker-controlled domain
The fix
The application should use a hardcoded or whitelisted domain for generating URLs and ignore client-supplied Host headers.
How it was found
- Intercept the password reset request.
- Change the Host header to an attacker-controlled domain.
- Forward the request and observe the reset email link points to the attacker's domain.
- Send a reset request for the victim's email with the modified Host header.
- The victim receives an email with a link to the attacker's server; when clicked, the token is sent to the attacker.
- Use the leaked token on the real site 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 ask a website to reset your password, it sends you an email with a special link containing a secret code. This website built that link using a value the requester can control (the Host header), so an attacker could make the link point to their own server. If the victim clicks it, the secret code goes to the attacker, who can 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.