Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Web cache poisoning stores a harmful response in a shared cache so that it is served to every subsequent visitor, turning a single crafted request into a mass attack.

What Is Web Cache Poisoning?
Caches exist to serve one stored response to many people. Web cache poisoning abuses exactly that property: an attacker sends a request that causes a harmful response to be stored, and the cache then delivers it to everyone who asks for the same resource. One request becomes an attack on every visitor until the entry expires, and the victims never interact with the attacker at all.
A cache decides whether a stored response may be reused by comparing a cache key, usually built from the host, the path, and the query string. Anything in the request that is not part of that key, but which still influences the response, is an unkeyed input, and that gap is the whole vulnerability.
A page that generates an absolute URL from the X-Forwarded-Host header is the classic example. The header is not in the cache key, so a request carrying an attacker’s domain produces a response containing a script tag pointing at that domain. The cache stores it under the ordinary key for the page, and every subsequent visitor loads the attacker’s script. James Kettle set out the technique in “Practical Web Cache Poisoning” at Black Hat USA in 2018 and extended it in “Web Cache Entanglement” in 2020, which showed how keys are normalised and how that normalisation can be exploited.
Common unkeyed inputs include X-Forwarded-Host, X-Forwarded-Scheme, X-Original-URL, X-Rewrite-URL, the Accept-Language and User-Agent headers where they alter content, and cookies the cache has been configured to ignore. Burp Suite’s Param Miner extension exists largely to discover them.
Some caches key on the path and query string while the application also reads a body from a GET request, or parses a parameter delimiter that the cache treats differently, such as a semicolon. Both produce a request that looks identical to the cache and different to the application. Parameter cloaking variants also exploit disagreement about which of two duplicate parameters wins.
Web cache deception reverses the direction. Instead of storing a malicious response for a normal URL, the attacker persuades the cache to store a personal response under a URL that looks static. A link to /account/profile.css may be routed by the application to the profile page, while the cache sees a .css extension and stores the result as a static asset. The victim clicks the link, their profile is cached, and the attacker then requests the same URL and receives their data. The defect is a disagreement between the cache’s rules and the application’s routing, rather than an injection.
A poisoned entry can carry injected script, which turns a reflected cross-site scripting issue that required a victim to click a crafted link into one that needs no interaction at all. It can carry a redirect to an attacker-controlled site, a broken response that denies service to a resource, or content that leaks internal hostnames and infrastructure detail. HTTP request smuggling is a frequent partner, because a desync lets an attacker place a response in the queue for an arbitrary URL.
Cache-Control: no-store, and the cache should be configured never to store a response to a request carrying authentication.Vary correctly where a header legitimately changes a response, remembering that an over-broad Vary destroys the hit rate.Probing for this on a live service is genuinely risky, because a successful poison affects real users. Work against a staging environment with the same cache configuration, add a unique cache-buster parameter to every probe so a poisoned entry cannot be served to anyone else, and verify the origin’s behaviour separately from the cache’s. Our web application security testing includes cache behaviour analysis on that basis, with the scope and timing agreed in advance.
Everyone who requests the affected resource while the entry remains stored, which on a busy site can be thousands of people within minutes. This is what separates cache poisoning from reflected attacks: the victim does not click a crafted link or interact with the attacker in any way. They simply visit the site normally and receive the stored malicious response.
Poisoning stores an attacker-controlled response under a normal URL, so everyone receives harmful content. Deception stores a victim’s personal response under a URL the attacker can request, so the attacker receives private data. Poisoning pushes content outwards to many users; deception pulls one user’s content into a location the attacker can read.
Add a cache-buster parameter so your probes cannot affect real traffic, then send candidate headers one at a time with a distinctive value and check whether it appears in the response. Burp Suite’s Param Miner extension automates the guessing against a large wordlist. Inspect cache status headers to confirm whether each response was stored or served fresh.
It is a disagreement between the two, so it must be fixed on both sides. The application should not let headers outside the cache key influence what it returns, and should mark user-specific responses as uncacheable. The cache should key on everything that matters and decide cacheability by route and content type rather than by file extension.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.