*URL Normalization Turns a Harmless Request into a Cache-Poisoned XSS Attack*
The application had an XSS vulnerability, but browsers URL-encode payloads, preventing execution. The cache normalised URLs before storing them, so an attacker could craft a request that the cache stored in a normalised form, leading to stored XSS when a victim visited the poisoned URL.
Published on infosecwriteups.com
In this lab, the core weakness lies in how the web cache and browser handle URLs differently. The application contains an XSS vulnerability, but browsers automatically apply URL-encoding, which prevents the payload from executing directly.
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
This could lead to widespread compromise of users, reputational damage, and compliance violations.
What the attacker needed
Victim clicks a link; cache normalises URLs
How it was found
- Access the lab and try a simple XSS payload in the comment field, which does not execute.
- Encode the payload and place it in the postId parameter; the server returns 'Invalid blog post ID' with X-Cache: miss.
- Remove the parameter and append the raw payload directly to the path; the server reflects it with X-Cache: miss.
- Repeatedly send the same request until the cache responds with X-Cache: hit.
- Deliver the malicious URL to a victim, and the payload executes.
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. This site had a cross-site scripting (XSS) bug, where an attacker could inject JavaScript, but browsers automatically encode special characters in URLs, stopping the attack. The cache, however, decoded the URL before saving it, so the malicious script was stored and later ran in victims' browsers.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.