Practical Web Cache Poisoning
portswigger.net
Practical Web Cache Poisoning
1–10 of 12 posts
Re: Practical Web Cache Poisoning
#2Re: Practical Web Cache Poisoning
#3The website I work at has an advertising partner cache bids and creatives, could these in theory be hijacked?
i.e. The cache looks for:
GET /advertisement/1
And caches the request body and other headers as a value with that line as the key. If you can manipulate the same key to have a different value, say by tweaking a cache-specific header, then the body of that GET response (an ad) changes for everyone hitting the same cache. Certainly worth testing with the tools that have been released ;)
EDIT: The tool in question, a plugin for Burp Community + Pro: https://github.com/PortSwigger/param-miner
Re: Practical Web Cache Poisoning
#4The concept is straightforward. You look for refxss in "unkeyed" inputs: those are inputs that alter the output of a cacheable page but aren't themselves part of the cache key. That "unkeyed" property is why his examples are all in things like the X-Forwarded-For header. Caches key on URL parameters (because they key on URLs), but tend not to use that header as a key, so two requests varying only in X-Forwarded-For are, to a cache, the same request. If you can trigger refxss in the unkeyed input, that refxss will be cached and fed to everyone else regardless of whether they use the same unkeyed input. Presto: stored XSS.
While that's super cool, if you're not already familiar with modern web application testing, I think the more interesting part of this post is the tour you get of the methodology Kettle uses to find vulnerabilities in the first place. The XSS examples he's providing aren't "novel"; the novelty is in tricking caches into storing them. But he uses the post as an opportunity to show off some advanced Burp features, which is useful even if you're not going to go test for cache poisoning.
Re: Practical Web Cache Poisoning
#5Excellent work!
Re: Practical Web Cache Poisoning
#6Re: Practical Web Cache Poisoning
#7Re: Practical Web Cache Poisoning
#8We were bitten because django's ALLOWED_HOSTS was set to accept anything and django's USE_X_FORWARDED_HOST setting was true.