01Issue
Overview
A web cache stores some responses so it can serve them quickly to later requests. Web cache deception occurs when a private application page is requested at a URL the cache mistakenly treats as a static file, causing the private response to be stored and potentially served to another visitor. This differs from cache poisoning: deception tricks the cache into storing a private response, while poisoning makes a cached response contain attacker-influenced content.
Common causes
- The application returns a private page for an unfamiliar path suffix or static-looking URL.
- The cache and origin normalize or route the same path differently.
- The cache rule treats a file extension as public even when the origin returns an authenticated page.
- Private responses do not have appropriate cache controls or edge rules override them.
References: RFC 9111: HTTP Caching ↗PortSwigger: Web Cache Deception ↗OWASP Web Cache Security Cheat Sheet ↗
02Examples
Hypothetical sequence: account A visits /account/profile and sees A-MARKER. In staging, request /account/profile.css, then request that exact URL from account B. If B receives A-MARKER and cache logs confirm a shared-cache hit, private response sharing is demonstrated. A cache hit without the other account’s content is not a disclosure.
03Impact
The origin must return user-specific content for the tested path, and a shared cache must store that response under a key another user can request. A static-looking URL or Age header alone does not prove that another user received the private response.
If a shared cache serves a stored private response to another user, that user may see the data contained in it until the entry expires or is purged. Verify the second request using a separate test account and identify the exact exposed fields.
04Testing
Test cases
1. Check whether a private response is shared
Using two test accounts, request an account-specific page through a path that may be treated as a static asset. Check the clean second account’s response and cache diagnostics.
Example: A response containing account A’s test data for account B is evidence of a cache isolation issue. A cache header alone is not.
GET /account/profile/test.css HTTP/1.1
Host: app.example.test
Cookie: session=TEST_ACCOUNT_A
2. Compare path interpretation and cache policy
Compare a normal private URL with a test path containing a static-looking suffix or path delimiter. Review how the cache and application resolve each URL.
Example: The cache may classify a URL as static while the application returns a profile page. Confirm both behaviors on the same request.
GET /account/profile/test.css HTTP/1.1
Host: app.example.test
Cookie: session=TEST_ACCOUNT_B
3. Review response controls and cache layers
Inspect Cache-Control and CDN rules for authenticated responses and overrides. Distinguish browser cache, shared cache, and origin output.
Example: A private browser cache is not the same as a shared CDN cache. Use provider diagnostics to identify reuse.
Testing references: RFC 9111: HTTP Caching ↗PortSwigger: Web Cache Deception ↗OWASP Web Cache Security Cheat Sheet ↗
05Mitigation
Configure private and authenticated routes to bypass shared caching, and return explicit Cache-Control: private or no-store policies according to the data and product needs. Make cache and origin path normalization consistent; do not rely only on filename extensions. Ensure CDN overrides cannot turn private responses into shared entries.
Retest
Purge the test cache entry, repeat path variants with two separate sessions, and confirm the second session receives no first-session content. Verify intended public static assets remain cacheable.