From Boredom to Bug: How One Backslash Broke the Entire Site
A CDN normalised a backslash in a request path to a forward slash and cached the origin's 404 response under the correct path. This caused all users to receive a cached 404 for a valid JavaScript asset, breaking the site.
medium.com
Published on medium.com
During a routine penetration test, I discovered a cache poisoning vulnerability caused by inconsistent path handling between a CDN and the origin server. A single backslash (\) in the request path triggered the CDN to cache a 404 response for a valid asset.
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 normalised backslashes to forward slashes for cache keys while the origin server treated them as different paths, causing a 404 to be cached under the valid path.
Impact
All visitors to the site could receive a cached 404 for a valid JavaScript file, breaking core functionality and appearance.
What the attacker needed
A CDN in front of the origin; CDN normalises backslashes; origin treats backslashes differently
The fix
The text does not state a fix was applied; organisations should ensure consistent path handling between CDN and origin and implement proper cache validation.
How it was found
- Send a request with backslashes in the asset path.
- Observe the origin returns a 404 for that malformed path.
- The CDN caches that 404 under the normalised forward-slash path.
- Request the valid forward-slash path and receive the cached 404.
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 is a network of servers that stores copies of website files to serve them faster. Here, the CDN treated a path with backslashes as the same as one with forward slashes, but the origin server did not. The CDN saved the origin's 'not found' error under the correct path, so everyone got the error instead of the real file.
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.