I Was Hunting Bugs — The Cache Was Hunting Users Instead
A user-specific API endpoint was cached by a CDN without proper cache-control headers, and an undocumented header was not included in the cache key. An attacker could poison the cache to serve their own authenticated response, containing sensitive data like an impersonation token, to other users.
infosecwriteups.com
Published on infosecwriteups.com
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 cache key did not include the Authorization header or the X-Client-Type header, and the endpoint lacked a Cache-Control: private directive, causing user-specific responses to be cached and served to others.
Impact
This could allow cross-user data leakage, exposure of admin features, account impersonation, and privilege escalation through shared cache abuse.
What the attacker needed
Attacker has a valid account; victim requests the poisoned endpoint; CDN caches responses without proper key
How it was found
- Send a request to the profile summary endpoint with a valid user token and observe that the response is cached.
- Send another request with a different user token and note that the same cached response is returned.
- Include an undocumented X-Client-Type header set to 'admin' in a request with an attacker token.
- Observe that the response contains internal role flags and admin metadata, and is stored in the cache.
- Access the poisoned cache as another user to receive the sensitive data, including an impersonation token.
- Use the impersonation token to access the admin impersonation endpoint.
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 cache is a temporary storage that saves copies of web responses to speed up loading. If a cache saves a page meant for one user and shows it to others, private information can leak. Here, the cache stored a response containing an admin token, which other users then received.
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.