Web Cache Poisoning via an Unkeyed Query Parameter
The web cache did not include certain UTM query parameters in its cache key, so an attacker could inject a script via such a parameter and have the poisoned response cached and served to other visitors. This allowed reflected XSS to become stored for all users until the cache refreshed.
Published on bashoverflow.medium.com
This vulnerability arises when a web cache does not properly include all query parameters in its cache key. In many implementations, certain parameters — often used for analytics or marketing purposes, such as utmsource or utmcampaign— are intentionally ignored to maximize cache efficiency.
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
Impact
Attackers could poison high-traffic pages such as the homepage or login page, causing every visitor to receive malicious content that could steal cookies or session tokens, or perform actions on behalf of authenticated users.
What the attacker needed
Cache ignores certain query parameters; application reflects those parameters
How it was found
- Send a GET request to the homepage to Burp Repeater.
- Add a cachebuster parameter to confirm cache misses occur.
- Inject a script payload via the cachebuster parameter and observe it executes only for the attacker.
- Replace cachebuster with a UTM parameter that is excluded from the cache key.
- Send the request repeatedly until the response shows a cache hit.
- Remove the payload and refresh the homepage; the script still executes from the poisoned cache.
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. If the cache ignores part of the request (like a tracking parameter) when deciding which stored copy to use, an attacker can sneak malicious code into that ignored part. The cache then serves the malicious page to everyone else.
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.