Cache Poisoning

High

Web Cache Poisoning

Definition

Web Cache Poisoning is a vulnerability that abuses the behavior of web caches (CDNs, proxies) to store and serve malicious responses to other users. The attacker sends a request with headers or parameters that are not part of the cache key but do affect the response, causing the poisoned version to be served to every visitor.

Impact

Mass Cross-Site Scripting (XSS) affecting every visitor of the pageMass redirection to phishing or malware sitesDenial of service by storing error responsesCredential theft at scale via poisoned login pages

Examples

Cache Poisoning via the X-Forwarded-Host header

The X-Forwarded-Host header is not part of the cache key but the application uses it to generate script URLs. The attacker manipulates it to inject their domain, and the cache stores the poisoned response, serving it to every user.

# Request with an uncached header that affects the response
GET /login HTTP/1.1
Host: victim.com
X-Forwarded-Host: evil.com

# The response includes a script pointing to the injected host:
HTTP/1.1 200 OK
<script src="https://evil.com/static/analytics.js"></script>

# This response is cached and served to ALL visitors of /login
# The attacker controls analytics.js and can steal credentials

Practice Cache Poisoning with real labs

Apply what you've learned in safe environments based on real bug bounty reports.

See practice labs
4,186

hunters training

68

labs from real hacks

2,125

completions

$14,790

paid out for these bugs

6 flags captured this week·Real hacks from HackerOne · YesWeHack · Bugcrowd·No commitment·Free Academy
Free · no account

The checklist I run on every new target

47 checks ordered by cost: first what can get you in trouble, then the cheap stuff, and finally the expensive stuff — which is where the big bounties are. I'll send it to your inbox right now.

Unsubscribe in one click, from any email.

BBLabs · bug bounty training

Stop reading about bugs and start hunting them

Create your free account and practice on labs based on real hacks that paid out thousands of euros. The Academy is free forever.

No card · free Academy · cancel anytime

The community

This isn't a platform with users.It's people breaking the same things you are.

Inside people ask, share what they found and solve together what would block anyone on their own. It's free to join: no account, no plan, no email required.

Join the BBLABS community on Discord
Join the Discord

Free and open. You don't need a BBLABS account to join.