How I discovered XSS via triple URL encode
A search box on a blog subdomain reflected user input without proper sanitisation, allowing an attacker to inject a script. By encoding the payload three times, the attacker bypassed a web application firewall and achieved cross-site scripting.
Published on medium.com
{{media:0}}
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
An attacker could execute arbitrary JavaScript in a victim's browser on the main domain, potentially leading to account compromise or data theft.
What the attacker needed
Victim visits a crafted URL; search box reflects input
The fix
The security team fixed the issue after two days.
How it was found
- Find a search box on a blog subdomain.
- Test a simple XSS payload in the search box; it reflects but does not execute.
- URL-encode the payload once and test; still no execution.
- URL-encode the payload a second time and test; still no execution.
- URL-encode the payload a third time and test; 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.
Cross-site scripting (XSS) is when a website shows user input without cleaning it, so an attacker can make the site run their own JavaScript. Here, the search box reflected a script tag, but a firewall blocked the obvious version. Encoding the payload multiple times hid it from the firewall, and the browser decoded it back to a working script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.