Skip to content

Bug class · Advanced

Web cache poisoning and deception

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.

median public bounty
$1,060

Covers CWE 524, 525, 349.

How it works

Full lesson

The pattern behind every report in this class.

Web cache poisoning and deception are attacks that abuse the shared caches sitting between users and a web application. In poisoning, an attacker manipulates a request so that the cache stores a harmful response, which is then served to other visitors. In deception, the attacker tricks the cache into storing a victim's private data, which they can later retrieve. These issues matter to bug bounty programs because a single poisoned cache entry can affect many users at once, turning a minor input handling flaw into a widespread compromise. Reports in this dataset cover both variants across blogs, help sites, download subdomains, APIs, sign-in pages, e-commerce and profile pages, often behind Cloudflare and other CDNs. [#17082, #16054, #18559, #20042, #9496, #33372]

Programs care because cache poisoning can lead to stored cross-site scripting, credential theft, session hijacking and malware distribution, while cache deception can expose personal data, CSRF tokens and authentication tokens. The impact is amplified by the cache's reach: one poisoned response can be served to every user who requests the same resource. Common root causes include unkeyed headers being reflected into responses, cache keys that ignore parts of the request, and caches that store error pages or sensitive content based on file extensions. These mistakes appear in features like generated JavaScript files, preview endpoints, raw snippet views, API responses and authenticated pages. [#14266, #14560, #14785, #15263, #16384, #18559, #20042, #28483]

The attack starts with the cache key, the set of request components the cache uses to decide whether two requests are the same. If a header, query parameter or other input influences the response but is not part of the cache key, an attacker can vary that input to poison the stored response. For example, the X-Forwarded-Host header was used to build absolute links but was not included in the cache key, so an attacker could make the cached page point to their domain. Similarly, the Origin header was omitted from the cache key, allowing a response tailored to one origin to be served to others. [#16384, #17082, #15263]

Another common enabler is insufficient validation or normalisation of inputs that end up in cached responses. Array parameters copied into generated JavaScript without validation, or parameter values reflected verbatim into a cached file, let an attacker corrupt the cached content. Length checks that count decoded characters rather than encoded bytes can be bypassed with multi-byte characters, allowing a longer payload to be reflected. Path traversal sequences that are not normalised can cause a sensitive response to be cached under a shareable path. [#14266, #14560, #14561, #21591, #28483]

Things to try

All 44

Each line worked in a disclosed report. Test only what a program's scope allows.

Host and forwarded headers 10

  • Send repeated requests with an X-Forwarded-Host header set to a domain you control, then request the same URL without the header to see whether the malicious hostname appears in the cached response.
  • Send repeated requests to a blog page with a spoofed X-Forwarded-Host header and check whether links in the cached page point at your domain.
  • Send X-Forwarded-Port and X-Forwarded-Host headers to a cacheable URL and check whether redirects pointing at an invalid port or host get cached.
  • Send an invalid app-instance routing header with a cache-busting query string and check whether the resulting 404 is cached and served to cookieless visitors.

Path and extension tricks 7

  • Request a dynamic cart or checkout page with an extra character such as a plus, minus or dot before the path, and check whether the no-cache headers disappear and cart cookies are set.
  • Craft a product URL containing a path traversal sequence after another product ID and check whether the cached entry replaces the legitimate product with the attacker's.
  • Append an image extension to a search URL that reflects a session token, then request the same URL from another browser and check whether the cached token can be reused.
  • Craft a URL with an encoded path traversal under a cached share path that resolves to a sensitive API endpoint, get a victim to visit it, then retrieve their auth token from the cache.

Authenticated page caching 6

  • Request a public board page without cookies after a signed-in visitor has loaded it and check whether their user id, CSRF token, CSP nonce and timezone are returned from the edge cache.
  • Visit a URL ending in a non-existent CSS file while logged in, then open it in a private window and check whether the cached page shows the user as logged in and leaks their details.
  • Append a non-existent file extension to an authenticated page URL, get a victim to open it, then visit the same URL and check whether their email, name and CSRF token are in the cached response.
  • Trick a user into opening a link on a subdomain and then request the same URL to see whether user-specific content was cached.

Error and redirect caching 5

  • Send a crafted URL that makes the server redirect to itself with an added trailing slash and check whether the redirect loop is cached for all visitors.
  • Send a crafted Authorization header to a file download URL and check whether the resulting 403 is cached and served to users without the header.
  • Send a request with an oversized custom header to a test path and check whether the resulting 400 response is cached and returned for later normal requests.
  • Send an unkeyed trailer header to a file download URL and check whether a malformed 400 response is cached for the legitimate file.

Header and version negotiation 4

  • Send a request to a framework page with an internal prefetch header and check whether an empty JSON object or error page with a 200 status is cached.
  • Send requests to a JSON API endpoint with different Origin headers and a unique query string, then check whether a response tailored to one origin is served to requests from other origins.
  • Send an Accept-Version header to a route that is not versioned behind a CDN and check whether the resulting 404 is cached for the normal URL.
  • Advertise an HTTP/3 alternative, then send Alt-Svc: clear and check whether a client keeps sending later requests to the separate backend.

Bypasses and variations

  • Bypass a decoded-character length limit by using multi-byte UTF-8 characters that expand to many URL-encoded bytes, then check whether the reflected value still poisons the cached file.
  • Append an .avif extension to a crafted URL and check whether the edge cache stores normally non-cacheable sensitive content.
  • Send more than 94 arbitrary headers and then append a header normally part of the cache key to see whether cache key evaluation and WAF rules are skipped.

Typical fixes

  • Restrict caching to specific addresses so dynamic pages are not stored

Tips for beginners

All 11
  • Start by identifying which parts of a request are reflected in the response but are not part of the cache key. Common candidates are headers like X-Forwarded-Host, X-Forwarded-Port, Origin and other custom headers. Send requests with these headers set to a domain you control and then request the same URL without them to see if the cached response contains your domain. [#16054, #17082, #16384, #14785]
  • Look for endpoints that generate JavaScript or other static files from parameters. If a parameter value is copied into the file without validation, you may be able to poison the cached file. Test with array parameters or special characters and check whether the corrupted output is served to normal requests. [#14266, #14560]
  • Test whether error responses are cached. Send requests that trigger 400 or 404 errors with a cache-busting parameter and then request the same URL normally to see if the error is served. This can be done with malformed headers, invalid routing headers or oversized headers. [#18213, #20180, #17446]
  • For cache deception, try appending a static file extension such as .css or .avif to an authenticated page URL. Visit the URL while logged in, then open it in a private window or another browser to see if your personal data or CSRF tokens are returned from the cache. Also try path traversal sequences to make sensitive API responses appear under a cached path. [#18559, #20042, #19213, #28483]
  • Check whether the cache respects cache-control headers. For example, preview endpoints that should not be cached may still be stored. Vary a parameter on a preview endpoint and see if cached results for users who later made content private are still served. [#13712]
  • When testing for poisoning, always use a cache-busting parameter to avoid affecting other users. Once you have a potential finding, demonstrate impact by showing that the poisoned response is served to a separate client without the malicious input. Avoid testing on production pages that many users visit. [#21966, #29460]

Start here: a reading path

Open the path

Clear reports in order, easiest first.

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on Cache bugs, from around the web.

Newest reports

All 262

Most recently disclosed.

New Cache bugs reports by email

Follow Cache bugs and get each week's new disclosures in one short email.

Free. New reports for what you follow, weekly by default. One-click unsubscribe. Privacy