Cache Crash: How I Poisoned CDN Responses and Became Every User
The CDN cached user-specific API responses publicly, and unkeyed headers allowed cache poisoning. An attacker could poison the cache to serve malicious scripts or steal cached session data, leading to account takeover.
Free link 🎈
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 CDN was configured to cache responses containing user-specific data and did not include certain request headers in the cache key, allowing cache poisoning.
Impact
The attacker could hijack sessions, deliver XSS to all cached page visitors, steal credentials, and achieve account takeover, potentially affecting thousands of users.
What the attacker needed
CDN caches user-specific responses; Unkeyed headers accepted; No authentication required to poison
How it was found
- Send a request to the target URL and observe cache headers such as X-Cache, Cache-Control, and Age.
- Test various headers to see if they affect the cache status (MISS/HIT).
- Identify headers that are not part of the cache key by sending a request with the header and then a normal request to check if the poisoned response is served.
- Inject a malicious payload via the unkeyed header to poison the cache.
- Verify that the payload is served from cache to subsequent users.
- Use the poisoned cache to deliver XSS or steal cached session 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 CDN (content delivery network) stores copies of web pages to serve them faster. If it stores private pages without checking who is asking, anyone can see another user's data. The author also found that some request headers were not considered when deciding which cached copy to serve, so they could trick the CDN into storing a malicious version for everyone.
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.