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.
Published on medium.com
#### Bilal Khan
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
- Set up a local Python server on port 8080 and ngrok on port 80 to receive requests.
- Capture the forgot password request in Burp Suite.
- Try various headers such as X-Host, X-Server, X-Forwarded-For, and X-Forwarded-Host with a malicious domain.
- Identify that X-Forwarded-Host: evil.com works and the reset link is changed to the attacker's host.
- 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.