When Old Breaches Meet New Code: Why Historical Leaks Still Matter
The report describes a web cache poisoning vulnerability where the X-Forwarded-Host header was not part of the cache key, allowing an attacker to inject a malicious script into a cached JavaScript file. The attacker could then serve the poisoned file to other users, potentially stealing session cookies.
infosecwriteups.com
Published on infosecwriteups.com
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 caching layer did not include the X-Forwarded-Host header in its cache key, allowing responses to be cached with attacker-controlled content.
Impact
The attacker could serve a poisoned JavaScript file to all users, potentially stealing session cookies and compromising admin accounts.
What the attacker needed
Ability to send HTTP requests with custom headers; target uses a caching layer that ignores X-Forwarded-Host
How it was found
- Send a request to the target JavaScript file with a modified X-Forwarded-Host header and observe that the response is cached.
- Craft a request that includes a malicious script in a header such as X-Original-URL.
- Fetch the JavaScript file again to confirm that the malicious script is now cached and served to all users.
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 web pages to speed up loading. If an attacker can trick the cache into storing a malicious version of a page, then everyone who visits that page gets the malicious version. Here, the attacker used a special header to inject a script into a cached JavaScript file, so when other users loaded the file, their browsers ran 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.