Skip to content
Cache bugs Write-up Intermediate

Web Cache Deception: How a Harmless .css Becomes Full Account Ta

Web Cache Deception tricks a shared cache into storing a victim's authenticated response under a URL that looks static, allowing an attacker to retrieve sensitive data such as session tokens. The article describes the general technique and cites a real-world example where ChatGPT's session endpoint leaked access tokens, enabling account takeover.

Krishna Kumar Follow

Published on xalgord.medium.com

The origin server and the cache in front of it parse the same path differently. The origin sees a dynamic, authenticated page.

Krishna Kumar, on xalgord.medium.com

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

The cache and the origin server interpret the same URL differently: the cache sees a static file extension and caches the response, while the origin ignores the extra path segment and returns dynamic, authenticated content.

Impact

An attacker could retrieve a victim's session token or personal data from the cache, potentially leading to full account takeover.

What the attacker needed

Victim clicks a crafted link; victim is authenticated; cache misconfiguration exists

The fix

The fix should make the origin's Cache-Control authoritative, cache based on Content-Type rather than URL suffix, and normalize paths identically at edge and origin to eliminate parsing discrepancies.

How it was found

  1. Map sensitive, authenticated endpoints that return user-specific data.
  2. Probe for a path-mapping discrepancy by appending a path segment and checking if the origin still serves the sensitive content.
  3. Check if the cache stores the response by sending a GET request with a cache buster and inspecting caching headers.
  4. Prove cross-session exposure by seeding the cache with an authenticated request, then requesting the same URL without cookies to see if the victim's data is returned.

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 shared cache (like a CDN) stores copies of web responses to speed up loading. If the cache thinks a URL points to a static file (like an image or stylesheet), it may store the response publicly, even if the response contains private data. An attacker can trick a victim into visiting a specially crafted URL that makes the cache store their private information, which the attacker can then read.

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.

More by Krishna Kumar

View all

10 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Web cache poisoning and deception

The lesson behind this report.

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.