Loading...
Advanced Tactics, Payloads and Real-World Methods to Uncover Hidden Cache Deception Flaws. Learn how attackers trick CDNs and reverse proxies into caching sensitive data, enabling unauthorized access and account takeover.

Web cache deception is a high-impact vulnerability where attackers trick caching mechanisms into storing and serving sensitive content, enabling unauthorized data access or account takeover. This guide covers advanced detection and exploitation techniques to help security professionals safeguard their applications.
Web Cache Deception (WCD) occurs when an attacker manipulates a caching system such as a CDN, reverse proxy or browser cache into storing sensitive content under what appears to be a harmless static resource. When another user requests that resource the cache serves the sensitive data instead, exposing information that should remain private. This typically arises from improper cache configurations, missing or incorrect security headers or flaws in how URLs and query parameters are processed.
https://target.com/account/style.css| Type | Description |
|---|---|
| Browser Caches | Store resources locally on a user's device |
| CDN Caches | Distributed caches at edge locations for faster delivery |
| Reverse Proxy Caches | Server-side caches that reduce origin server load |
| Header | Purpose |
|---|---|
| Cache-Control | Directives for caching mechanisms |
| Pragma | HTTP/1.0 header for cache control |
| Expires | Specifies when the response expires |
| ETag | Identifier for a specific version of a resource |
| Last-Modified | Indicates when the resource was last modified |
Caches use keys to identify and store resources. These keys are typically based on:
Online tools like giftofspeed.com can help determine if a resource is being cached. These tools analyze HTTP responses and provide insights into caching behavior. You can enter the full URL with your cache key to test it or use the base domain to discover which resources are currently cached.


| Header | What to Look For |
|---|---|
| Cache-Control | no-store, no-cache (sensitive); public, max-age=86400 (cached) |
| Expires | Future date → likely cached until then |
| ETag | Present → can validate/compare versions |
| Last-Modified | Recent timestamp vs. origin changes |
| Vary | Vary: Cookie or missing → important for auth-sensitive content |
| X-Cache | HIT = served from cache, MISS = not cached |
| Age | Age > 0 → response came from cache |
| Pragma | Pragma: no-cache → indicates no-cache |
| Surrogate-Control | max-age=... or no-store for CDNs |
| X-Served-By | Identifies the server/CDN node that served the request |
| CF-Cache-Status | HIT, MISS, EXPIRED, BYPASS (Cloudflare) |
| X-Cache-Status | HIT / MISS / STALE / BYPASS |
HIT means the content was served from the cache.
MISS means the content was fetched from the origin server.
X-Cache: dynamic indicates the response was generated dynamically.
X-Cache: refresh shows that the cached content was outdated and refreshed.
curl -I https://target.com/account.csscurl -I -H 'Cache-Control: no-cache' https://target.com/account.csscurl -I https://target.com/account.css ; curl -I https://target.com/account.css?v=$(date +%s)time curl -s -o /dev/null -w '%{time_total}' https://target.com/account.csscurl -s -D - https://target.com/account.css -o /dev/null | grep -iE 'x-cache|cf-cache|age:|cache-control|expires|etag'The server processes /account.php as a PHP script, but due to the added /poc.css suffix the CDN caches the HTML/PHP-generated sensitive content as if it were a static CSS file. Anyone visiting the URL later gets the cached sensitive data without authentication.
GET /account.php/poc.css HTTP/1.1
Host: vulnerable-example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0)
Accept: text/css,*/*;q=0.1
Cache-Control: no-cacheHTTP/1.1 200 OK
Date: Mon, 11 Aug 2025 09:40:18 GMT
Content-Type: text/css
Content-Length: 412
Cache-Control: public, max-age=86400
X-Cache: HIT
/* Cached response exposing sensitive data */
body { background-color: #fff; }
/* Attacker view */
username: johndoe@example.com
email: johndoe@example.com
session_token: 9f73b21d2e934f6e4cbdc8d83c4e9210The server processes /account.php as a PHP script, but due to the added /poc.css suffix the CDN caches the HTML/PHP-generated sensitive content as if it were a static CSS file. Anyone visiting the URL later gets the cached sensitive data without authentication.
When looking for web cache deception bugs, some endpoints are more likely to be vulnerable. Start by checking these common sensitive paths first:
When testing for cache deception, append various file extensions to sensitive endpoints to make them appear as static resources:
These headers can deceive caching systems into handling a dynamic response as if it were tied to a different cacheable URL:
URL encoding can confuse backend vs frontend behavior, potentially creating cacheable paths that access sensitive data:
Many CDNs cache based on certain query parameters. Attackers can exploit this by crafting URLs:
Use these delimiters and special characters to creatively manipulate URLs and bypass cache rules:
Try inserting these special delimiters right before file extensions to see if caching systems mishandle the URLs:
Use URL-encoded special characters before file extensions to bypass cache rules:
Test URLs by appending file extensions combined with /* to trick caches into storing sensitive responses:
Discovery: A tester noticed that /user/profile contained sensitive user information.
Testing: The tester appended a static extension to the URL: /user/profile.css
Verification: After logging out and accessing /user/profile.css in incognito, the same sensitive data was returned.
Root Cause: The CDN was caching based on the file extension, treating the .css URL as a static resource while the backend still processed it as a profile request.
Discovery: An API endpoint at /api/user/data returned JSON with user-specific information.
Testing: The tester added a cache-busting parameter with a static extension: /api/user/data?callback=static.js
Verification: When accessed without authentication, the endpoint returned the cached user data.
Root Cause: The CDN was configured to cache based on the presence of certain query parameters.
curl -I https://target.com/account.cssUse these one-liner automations to hunt Web Cache Deception vulnerabilities at scale:
This pipeline does the following: Gets all URLs for the target domain using gau. Filters URLs to only keep those with sensitive paths like /account, /profile, /admin, etc. Saves the filtered URLs to a file. Appends /style.css to each URL to mimic a static file (a common cache deception trick). Uses httpx-toolkit to check which URLs respond with HTTP 200, showing live pages that might be cached improperly.


Ensure sensitive endpoints include: Cache-Control: no-store, no-cache, private
Configure caches to include authentication status or session identifiers in cache keys
Implement URL normalization to prevent encoded paths from bypassing cache rules
Host static resources on separate domains or subdomains with different caching policies
Web cache deception is a powerful attack vector that can expose sensitive information and bypass security measures. By understanding the default paths, sensitive headers and various techniques to manipulate caching behavior you can identify and exploit these vulnerabilities effectively. Always remember to use tools like the Gift of Speed Cache Checker to analyze caching behavior and uncover potential weaknesses.
You can also watch this video walkthrough showing the full practical demonstration of these methods in action, including account takeover:
Burp Suite extension for automated web cache deception scanning
Interactive practice lab for web cache deception
Online tool to analyze HTTP responses and determine if a resource is cached
Full practical demonstration including account takeover via cache deception