Hostile Host Headers: How I Hijacked the App with One Sneaky Hea
The application trusted the incoming Host header and reflected it in password reset emails, canonical links and absolute URLs. An attacker could send a victim a reset link pointing to their own domain, and could also poison a shared cache so other users were served pages linking to the attacker's domain.
Free Link🎈
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 untrusted Host header (and X-Forwarded-Host) to build absolute URLs instead of a fixed configured hostname.
Impact
An attacker could phish users with password reset links pointing to their own domain and could poison a shared cache so other users were served pages linking to the attacker's domain, potentially enabling session stealing, CSRF attacks and fake login portals.
What the attacker needed
Victim clicks a link or opens a reset email; attacker controls a domain; shared cache in front of the app
How it was found
- Send a request to the target with a modified Host header and X-Forwarded-Host header pointing to an attacker domain.
- Observe that the attacker domain is reflected in password reset emails, canonical links and absolute URLs.
- Trigger a password reset for a victim with the modified Host header so the reset link points to the attacker domain.
- Send a request to a cacheable page with the malicious Host header to poison the CDN cache with links to the attacker domain.
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.
Every web request carries a Host header that says which site the browser wants. If a site blindly trusts that value when building links, an attacker can make the site generate links to their own domain. That lets them phish users with a real-looking password reset email or poison a shared cache so other visitors get malicious links.
What is Cache bugs?
A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.