Find unkeyed headers with a cache buster before you test for cache poisoning
Cache poisoning only works when the response changes because of an input the cache does not include in its key. Test that safely first: add a unique query parameter so you only ever poison your own cache entry.
GET /?cb=7f3a91 HTTP/1.1
Host: target.example
X-Forwarded-Host: canary.exampleRepeat the same request without the header and with the same cb value. If the second response still contains canary.example (in a script src, a canonical link, an og:url or a redirect Location), the header is reflected and the response was stored without it in the key. Cache headers such as Age, X-Cache: hit or CF-Cache-Status: HIT confirm the second answer came from the cache. Try X-Forwarded-Scheme: http, X-Host and X-Forwarded-Server the same way.
Why it works: the cache keys on method, host and path, while the application builds absolute URLs from forwarded headers it trusts.
Proof of impact: a fresh request from another IP or session, using the same cache-busted URL, returns your value. Reflection that is not cached, or a page that sends Cache-Control: private or no-store, is not exploitable and not worth reporting. Never poison the real, unbusted URL, and stay in scope.
Follow #cache-buster, #cache-poisoning, #unkeyed-header or #x-forwarded-host for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.
Comments
No comments yet.