How I chained Host header Injection to Password Reset Link Poisoning to XSS and Account Takeover.
The password reset endpoint built the reset link from the attacker-controlled X-Forwarded-Host header, so the emailed link pointed at the attacker's domain. Because the attacker's page reflected the request path into a script, opening the poisoned link ran attacker JavaScript and logged the victim's IP and reset token, which the attacker then used to reset the password.
Published on infosecwriteups.com
How I chained Host header Injection to Password Reset Link Poisoning to XSS and Account Takeover.
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 trusted the client-supplied X-Forwarded-Host header when generating the absolute password reset URL, and the attacker's landing page reflected the request path into a script.
Impact
An attacker could poison the reset link, capture the victim's token and IP, and take over the account; the XSS only ran on the attacker's own domain, not the target.
What the attacker needed
Victim's email address; victim opens the poisoned reset link; attacker-controlled domain
How it was found
- Send a password reset request for the victim's email with the X-Forwarded-Host header set to the attacker domain.
- Receive the reset email and observe that the link points to the attacker domain.
- Open the poisoned link, which triggers the reflected script on the attacker page.
- Check the attacker dashboard to see the logged IP and reset token.
- Rewrite the link to the real site with the stolen token and 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 site to reset your password, it emails you a link. This site built that link from a header the sender controls, so the email pointed to the attacker's own website instead. The attacker's page then showed a script that recorded the secret reset token, letting them change 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.