Skip to content

Caching Behavior & Web Cache Deception

These checks build on the same RFC 9111 (HTTP Caching) semantics as cache-detective — caching.authenticated_caching and caching.cache_deception reuse its cache/checks/cacheability cacheability determination directly, and caching.vary_consistency reuses its cache/cdn cache-status detection.

Check IDTitleCVSS 4.0CWEOWASP
caching.authenticated_cachingAuthenticated Response Marked Cacheable8.7CWE-524API1:2023
caching.vary_consistencyUndeclared Cache-Key Input5.3CWE-444API8:2023
caching.cache_poisoningCache Poisoning via Unkeyed Header9.3CWE-444API8:2023
caching.cache_deceptionWeb Cache Deception via Path Confusion8.1CWE-524API1:2023

Sends a request carrying credentials (a bearer token and a cookie) and checks whether the response is cacheable per RFC 9111 §3.5 without one of that section’s opt-in directives (must-revalidate, public, s-maxage) — a shared cache/CDN in front of the origin isn’t supposed to store a response to a request carrying Authorization otherwise. Severity is compounded in the finding description when the response body or Set-Cookie header carries PII, tokens, or session data (detected the same way as cache-detective’s equivalent check).

Remediate: send Cache-Control: private, no-store (or an explicit opt-in if the response is genuinely safe to share) on every authenticated response.

Probes whether Accept-Encoding, Accept-Language, and a custom header actually change the response, and compares that against the declared Vary header. An input that changes the response but isn’t declared in Vary means a cache keyed only on the declared dimensions can serve one variant to a request that should have gotten another — a cache-poisoning surface whenever that input is attacker-controlled.

Remediate: declare every request header the response actually varies on in Vary, or stop varying on it.

Injects a marker via a header commonly left out of the cache key (X-Forwarded-Host, X-Original-URL, Accept-Language) and checks whether a follow-up plain request — no such header — receives the poisoned response.

Remediate: either strip these headers before they can influence the response, or include them in the cache key.

Appends a static-file extension or a nonexistent sub-path to the target’s own path and checks whether the origin serves the exact same response under that path, and whether that response looks cacheable — the classic web-cache-deception surface where a path like /account.js ends up caching a user’s authenticated /account response for anyone who requests it.

Remediate: key the cache on the full normalized path (or disable caching for authenticated routes regardless of extension), and don’t let the origin serve a dynamic route’s content in response to a request for what looks like a static asset.