From Paste Site to Payout: How a Single Dump Led to a Critical Bug
The caching layer ignored the X-Forwarded-Host header when building its cache key, while the backend used that header to construct asset URLs. An attacker could poison the cache so that normal users received responses pointing to an attacker-controlled domain, potentially enabling session theft or content manipulation.
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 cache key did not include the X-Forwarded-Host header, while the backend used that header to generate absolute URLs in the response.
Impact
The vulnerability could allow cache poisoning, injection of attacker-controlled assets, potential session theft, and content manipulation for all users.
What the attacker needed
Access to a paste dump with infrastructure hints; Ability to send HTTP requests with custom headers; Target uses a caching layer that ignores X-Forwarded-Host
The fix
The security team fixed it by updating their caching configuration and properly validating forwarded headers.
How it was found
- Extract domains and endpoints from a paste dump.
- Enumerate subdomains and identify cdn-cache.targetcorp.com.
- Fingerprint the infrastructure to find nginx and Varnish.
- Find a cacheable endpoint /v3/products/list.
- Test header manipulation by sending X-Forwarded-Host: attacker-domain.com and observe the response containing attacker-controlled URLs.
- Send a request with the malicious header to poison the cache, then send a normal request and confirm the poisoned response is served.
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 cache is like a shared storage that saves copies of web pages to serve them faster. The bug happened because the cache saved a page that was built using a special header (X-Forwarded-Host) that told the server to use a different domain for images. Since the cache didn't consider that header when deciding which saved copy to serve, an attacker could make the cache store a malicious version and then show it to everyone.
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.