*Combining Web Cache Poisoning with X-Forwarded-Host and X-Original-URL Headers*
The application mishandled the X-Forwarded-Host and X-Original-URL headers, allowing an attacker to poison the web cache with a malicious translations file. This resulted in persistent cross-site scripting that executed for any user visiting the cached page.
Published on infosecwriteups.com
Learn how combining X-Forwarded-Host and X-Original-URL vulnerabilities can poison web caches, delivering persistent XSS to unsuspecting users.
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
Impact
In production, this could lead to persistent cross-site scripting, where every user who loads the poisoned cached page executes the attacker's payload.
What the attacker needed
Ability to send custom headers; victim visits the poisoned page
How it was found
- Observe the homepage requests in Burp HTTP History.
- Use Param Miner to guess headers and identify X-Forwarded-Host and X-Original-URL.
- Test X-Forwarded-Host manually to see if the response reflects the supplied domain.
- Identify the language switch behaviour that sets a lang cookie and redirects.
- Host a malicious translations file on an Exploit Server with CORS allowed.
- Send requests with X-Forwarded-Host pointing to the Exploit Server and X-Original-URL to trigger a cacheable redirect, then verify the payload executes.
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.
A web cache stores copies of pages to serve them faster. Here, the server trusted two special headers that told it which domain to use and which path to take, so an attacker could make the cache store a page that loads malicious JavaScript from the attacker's server. Then every visitor to that page would run the attacker's script.
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.