web-cache-deception
Web cache deception and poisoning playbook. Use when CDN, reverse proxy, or application caching may serve sensitive authenticated content to other users due to path confusion or cache key manipulation.
Security Assessment
About web-cache-deception
A security-testing playbook for web cache deception and web cache poisoning. It applies when a CDN, reverse proxy, or application caching layer may serve sensitive authenticated content to other users because of path confusion or cache key manipulation. The skill draws a clear distinction between the two attack families: cache deception steals authenticated data, while cache poisoning serves malicious content to other users.
For cache deception, the methodology is to identify cacheable path patterns (CDNs commonly cache by extension such as .css, .js, .png, or .json), test path confusion by appending a static extension to an authenticated endpoint, verify caching by comparing X-Cache MISS then HIT and Age headers across an authenticated request and an unauthenticated one, and then deliver the crafted URL to a victim. It highlights that the vulnerability arises because the CDN and the application normalize paths differently, and it covers path-separator tricks using semicolons, encoded slashes, and trailing dots or spaces.
For cache poisoning, it focuses on unkeyed request inputs. Cache keys typically include Host, path, and query string but not headers like X-Forwarded-Host, X-Forwarded-Scheme, or X-Original-URL, so reflecting these into a cached response can inject attacker-controlled links, meta tags, or scripts affecting all users. A defense section recommends caching only explicitly static paths, setting Cache-Control no-store or private on authenticated endpoints, using Vary: Cookie, including reflected headers in the cache key, and stripping unknown headers at the edge. An advanced reference adds CDN-specific behavior for Cloudflare, CloudFront, Akamai, Varnish, and Fastly, plus Vary and cache-partitioning topics, and a testing checklist ties it together.
FAQ
What is the difference between cache deception and cache poisoning?
Cache deception tricks a victim into caching their authenticated page at a URL the cache treats as static so the attacker can read it, while cache poisoning manipulates unkeyed inputs so the cache stores a malicious response served to normal users.
When should this skill be used?
When a CDN, reverse proxy, or application caching layer may serve sensitive authenticated content to other users due to path confusion or cache key manipulation.
How do you verify that a response was actually cached?
By checking cache indicators such as X-Cache showing MISS on the first request and HIT on a repeat, along with the Age header, and confirming an unauthenticated request returns the victim's authenticated content.
Which unkeyed headers does it test for poisoning?
Headers typically excluded from the cache key such as X-Forwarded-Host, X-Forwarded-Scheme, X-Forwarded-Proto, X-Original-URL, X-Rewrite-URL, X-Host, and Forwarded, among others.
What defenses does it recommend?
Cache only explicitly static paths, avoid caching on file extension alone, set Cache-Control no-store or private on authenticated endpoints, use Vary: Cookie, include reflected headers in the cache key, and strip unknown headers at the CDN edge.
Install web-cache-deception
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
yaklang/hack-skills