How a Cache Keys Mismatch Led to a Web Cache Deception Account Takeover
A mismatch between how NGINX and the Node.js backend handled URL path extensions allowed an attacker to cache a victim's private API key under a public URL. The attacker could then retrieve the cached response without authentication, leading to account takeover.
Web Cache Deception (WCD) occurs when an intermediary caching layer — such as a Content Delivery Network (CDN) or reverse proxy — stores a response containing sensitive user data because it misinterprets a dynamic request as static content.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the caching layer and the origin server disagreed on how to interpret a URL with an extra path extension, causing the cache to store a dynamic response as if it were a static file.
Impact
An unauthenticated attacker could retrieve a victim's private API key and account details, leading to full account takeover.
What the attacker needed
Victim logged in; victim clicks a crafted link; attacker can send unauthenticated requests
The fix
The report recommends strict path matching at the origin, respecting origin cache-control headers, and using content-type headers in cache rules.
How it was found
- The victim is logged into the dashboard.
- The attacker tricks the victim into visiting a URL ending in .css that points to a sensitive API endpoint.
- The victim's browser sends the request with session cookies, and the backend returns private data.
- NGINX caches the response because the URL ends in .css.
- The attacker makes an unauthenticated request to the same URL and receives the cached private data.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A caching server (like a CDN) stores copies of web pages to speed things up. Here, the cache thought a URL ending in .css was a harmless static file, so it saved the response. But the backend ignored the .css and returned private account data, which the attacker could then fetch from the cache without logging in.
What is Cache bugs?
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.