Cache Me If You Can How I Poisoned The Cdn And Hijacked User Sessions
The CDN cached user-specific profile responses without varying by the X-Original-URL header, so an attacker could poison the cache to serve another user's private data to anyone requesting the same URL. The attacker could also poison a cacheable config endpoint to expose secrets like JWT_SECRET and DB_URI to unauthenticated visitors.
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 cache key did not include the X-Original-URL header, and the origin server used that header to determine which user's data to return, allowing cache poisoning.
Impact
An attacker could poison the cache to serve another user's private profile data to anyone visiting the poisoned URL, and could also expose secrets like JWT_SECRET and DB_URI to unauthenticated visitors.
What the attacker needed
Ability to send custom headers; victim visits poisoned URL
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) is a shared cache that stores web responses to speed up loading. If it stores a response meant for one user and serves it to others, private data leaks. Here, the server used a header to decide which user's data to return, but the cache ignored that header, so the attacker could make the cache store someone else's data under a public URL.
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.