Web Cache Deception: When a 404 Still Leaks Sensitive Data ️️♂️
A profile page returned sensitive user data even when accessed with a fake .css extension and a 404 status, and the response was cached by a CDN. An attacker could force caching and then retrieve another user's cached profile data without authorisation.
Published on medium.com
This was one of the first real reports I submitted under my hacker name, ValidByAccident. It marked a defining step in my bug bounty journey — a classic case of Web Cache Deception, but with a strange twist that made it especially memorable.
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 application returned sensitive user data in 404 error responses and the CDN cached those responses without proper cache-control headers or user-specific isolation.
Impact
An attacker could retrieve other users' cached profile data, including emails and linked authentication accounts, without authorisation, and could potentially scrape this data at scale.
What the attacker needed
A free account; victim visits a crafted URL; CDN caching enabled
The fix
The application should not include sensitive user data in error responses and should set cache-control headers to prevent caching of authenticated or personal content.
How it was found
- Log in as User A and visit the profile settings page, capturing the request that reveals personal data.
- Change the URL to add a fake .css extension and observe that sensitive data is still returned despite a 404 status.
- Send the fake URL repeatedly until the cache status shows a hit and a non-zero age.
- Switch to User B or a private window and visit the same fake URL to see User A's cached 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 web cache stores copies of pages to serve them faster. Here, the server sent private profile information even for a made-up address that ended in .css, and the cache saved that response. Because the cache key included the fake address, another user could request the same address and receive the first user's private data.
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.