Bypassing WAFs: A Unique XSS Exploit Journey and Insights
A reflected cross-site scripting vulnerability was found in a URL parameter on an inner page of a colour selection website. The attacker bypassed the Web Application Firewall by double URL-encoding the payload, allowing script execution in the victim's browser.
medium.com
Published on medium.com
Hello, friends! After a long time since my first article on Medium, I’m back with an exciting new piece.
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 application failed to properly sanitise or encode user input before reflecting it into the page, and the WAF only inspected single-encoded input.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, potentially leading to session theft or other client-side attacks, though the text only demonstrates an alert box.
What the attacker needed
Victim clicks a crafted link; WAF present but bypassable
How it was found
- Perform reconnaissance to list pages on the target site.
- Identify a URL parameter on an inner page that appears to be reflected.
- Test the parameter with various payloads, observing that the WAF blocks them.
- Modify the payload by double URL-encoding special characters.
- Submit the double-encoded payload and observe the alert box executing.
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 takes input from a user and puts it into a page without cleaning it, so an attacker can make the site run their own JavaScript. Here, the attacker hid a script inside a link using double encoding (turning characters into percent codes twice) so the security filter (WAF) did not recognise it. When a victim opens the crafted link, the script runs in their browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.