When a Login Page Became a Trap: My Discovery of a Web Cache Dec
A login endpoint returned personalised HTML containing a CSRF token, and appending a .js extension caused the CDN to cache that response. An attacker could trick a victim into visiting the crafted URL, then retrieve the cached page to obtain the victim's token and potentially take over the account.
Some bugs scream for attention. Others whisper quietly in the background… until you notice something that just doesn’t feel right.
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 cached dynamic HTML based on the URL ending in .js, while the origin server returned the personalised login page for that path without setting no-store headers.
Impact
An attacker could trick a victim into visiting the crafted URL, then retrieve the cached response to obtain the victim's CSRF token, potentially leading to account takeover or CSRF attacks.
What the attacker needed
Victim clicks a crafted link; CDN caches the personalised response
The fix
The report recommended setting Cache-Control: no-store on auth routes, blocking fake static extensions, allowlisting cacheable paths, respecting origin headers, and reviewing all auth endpoints; it does not state whether these were implemented.
How it was found
- Send a GET request to the login endpoint with a .js extension appended.
- Observe that the server returns the full login page with a CSRF token.
- Check the response header and see CF-Cache-Status: HIT, indicating the page was cached.
- Refresh and confirm the cached response is still served.
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 content delivery network (CDN) is a service that stores copies of web pages to serve them faster. This report shows that the CDN mistakenly stored a personalised login page, including a secret token used to protect forms, because the URL looked like a static file. An attacker could then fetch that stored copy and use the token to act as the victim.
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.