Web Cache Deception vs. Poisoning: Risks and Prevention
Understand how web cache deception leaks private data, how cache poisoning spreads harmful responses, and which controls help protect your system.

Illustration: ITGRATE’s existing product-support artwork, showing browser-response review. Conceptual artwork; it does not depict a specific incident or product.
Web cache deception exposes private content by getting it stored where others can retrieve it. Web cache poisoning gets an attacker-influenced response stored and delivered to other visitors. Both exploit gaps between application behavior and caching decisions. Understanding that difference helps teams choose the right controls. See PortSwigger’s deception overview and poisoning overview.
For product leaders, the concern is customer trust: a performance feature can become a path to disclosure or harmful content. For engineers, the task is to define which responses may be shared, then prove that every cache follows that policy.
At a glance
- Deception: private information is cached and exposed to someone else.
- Poisoning: attacker-influenced content is cached and served to visitors.
- Protection: control cache eligibility, align cache keys with response behavior, and verify isolation across users.
How a shared web cache decides what to serve
A content delivery network (CDN) or reverse proxy can store an origin server’s response and reuse it. A cache key identifies which requests count as equivalent; cache rules determine storage and reuse. The security question is whether two requests sharing a key should really receive the same response. Cloudflare’s cache-key documentation explains how URL components, headers, and cookies can participate in this decision.
Product takeaway: Document both the cache key and cache eligibility for each important route; knowing only the cache lifetime is insufficient.
What is web cache deception?
Web cache deception tricks a shared cache into storing sensitive, personalized content. The origin and cache interpret a request differently: the application returns a private page, while the cache treats the URL as a reusable static resource. An attacker can then retrieve the stored response. PortSwigger describes this request-handling mismatch.
Illustrative scenario: a signed-in customer follows an unusual account URL. The application still returns account information, but a static-looking suffix triggers caching. Someone requesting that URL later receives the cached information. The login check may have worked at the origin; the later response came from the shared cache.
Product takeaway: Treat unexpected URL forms on private routes as a security concern, even when the normal account URL behaves correctly.
What is web cache poisoning?
Web cache poisoning causes a harmful response to be stored and reused for other visitors. A common cause is an unkeyed input: request data changes the origin’s response but does not distinguish the cache entry. Later visitors receive content influenced by a request they never sent. PortSwigger’s explanation describes risks including malicious scripts and redirects, depending on the underlying application behavior.
Illustrative scenario: an application uses an untrusted forwarded-host value to construct a resource link. If the modified page is cached under the ordinary page’s key, other visitors can receive that altered link. This is HTTP response caching, a different mechanism from DNS cache poisoning.
Product takeaway: Review every input that changes a shared response, including inputs outside the visible URL.
Prevent deception with explicit route policies
Cache only routes deliberately approved for sharing. Reject unexpected path segments on private endpoints and keep path normalization consistent between the edge and origin. A filename suffix alone must not decide that a response is public. These are OWASP’s recommended controls.
Where available, enable checks that compare the requested extension with the returned Content-Type. Cloudflare’s Cache Deception Armor provides this protection, with documented exceptions. Treat it as an additional check: it cannot replace a deliberate policy for personalized content.
Product takeaway: Start with account, billing, dashboard, and authenticated API routes; verify that static-looking variations cannot make their private responses shareable.
Prevent poisoning by removing input ambiguity
Do not let untrusted headers determine links, redirects, or content in shared responses. Cloudflare recommends avoiding untrusted header reflection and ensuring that unkeyed inputs cannot change cacheable output. It also warns that GET request bodies can affect an origin response without being included in its cache key. See Cloudflare’s poisoning prevention guidance.
For legitimate response variations, explicitly configure the key or bypass shared caching. Do not blindly add arbitrary attacker-controlled headers to keys: first decide whether the application should accept those inputs at all. Check provider-specific support before relying on Vary.
Product takeaway: Make a short inventory of response-changing inputs and record whether each is rejected, represented in the key, or handled without shared caching.
Understand what Cache-Control actually protects
For sensitive responses that must not be stored, use Cache-Control: no-store. The directives solve different problems:
- no-store tells compliant caches not to store the response.
- private prevents shared-cache storage but permits a private browser cache.
- no-cache permits storage and requires successful validation before reuse.
These distinctions come from RFC 9111. The standard also states that Set-Cookie alone does not prohibit caching. A session cookie is not a substitute for an explicit response policy.
Check the delivered response and intermediary configuration, not just application code. Ensure CDN rules do not override private-route protections. Adding no-store does not remove an older cached copy; invalidate affected entries separately, as MDN’s Cache-Control reference explains.
Product takeaway: Verify origin headers, CDN overrides, and existing entries together whenever a sensitive route’s policy changes.
Test isolation and prepare for incidents
Use authorized test environments and synthetic data. Exercise the same CDN and proxy configuration used in production. Compare two test accounts, different tenants, and anonymous requests; private content must remain isolated.
Change one request component at a time, inspect cache-status evidence, and test unexpected path forms. Include logout, permission changes, and invalidation of already stored entries. OWASP recommends testing this complete cache path.
If exposure or poisoning is suspected, preserve relevant evidence, bypass affected shared caching, fix the cause, and purge impacted layers. Assess what information or credentials were exposed. Purging alone does not repair the vulnerability.
Product takeaway: Make cache isolation a release criterion and assign ownership for investigation, containment, and cache invalidation.
What this means for builders
ITGRATE’s recommendation is to review caching with the same care as access control. Product leaders should ask which customer responses are shareable and who owns that decision. Engineering teams should bring route policy, edge configuration, and isolation tests into the same review.
The next step is concrete: choose one sensitive journey, map every cache it crosses, and verify its behavior with separate test identities. Extend that evidence into a repeatable release check.
Sources
PortSwigger: Web cache deception
PortSwigger: Web cache poisoning
Cloudflare: Cache Deception Armor
Cloudflare: Avoid web cache poisoning
IETF: RFC 9111 — HTTP Caching (June 2022)
OWASP: Web Cache Security Cheat Sheet
Technical sources reviewed on 18 November 2026 (Asia/Ho_Chi_Minh).


