The Art of Sneaking Past Security
So you found an XSS vulnerability, but your payload gets blocked? Welcome to the real game. Modern applications use Web Application Firewalls (WAFs), input sanitization, and Content Security Policies to stop XSS. But like a lockpick artist facing a new lock, there's almost always a way through.
This lesson is about creative problem-solving. We'll explore dozens of techniques to bypass XSS filters, from simple case changes to advanced browser quirks. By the end, you'll think like both an attacker and a defender.
This builds on , , and . Make sure you understand basic XSS before diving into bypasses.
Related
XSS Fundamentals
Related
Reflected XSS
Related
Stored XSS
Know Your Enemy: How Filters Work
Before bypassing filters, understand how they work. Most filters fall into these categories:
1. Blacklist Filters
2. Whitelist Filters
3. Encoding/Escaping
4. WAF (Web Application Firewall)
Basic Bypass Techniques
Case Manipulation
Tag Variations
Event Handler Alternatives
There are 100+ HTML event handlers. When one is blocked, there are many alternatives. Check PortSwigger's XSS cheat sheet for a complete list.
Encoding Tricks
URL Encoding
HTML Entity Encoding
Unicode Tricks
JavaScript Encoding
JavaScript Obfuscation
Avoiding "alert"
Avoiding Parentheses
Avoiding Quotes
Context-Specific Bypasses
Breaking Out of JavaScript Strings
Breaking Out of HTML Attributes
JavaScript Template Literals
CSS Context
WAF Bypass Techniques
Character Insertions
Protocol Variations
Request Smuggling
Mutation XSS (mXSS)
WAF bypasses are specific to each WAF product. What works for one may not work for another. Always test multiple techniques.
Practice Challenges
Knowledge Check
Key Takeaways
- Case manipulation often bypasses filters - HTML is case-insensitive
- Alternative tags and events: There are 100+ HTML event handlers
- Encoding tricks: URL, HTML entities, Unicode, and JavaScript encoding
- Avoid filtered functions with window["alert"], confirm, prompt, or eval
- Template literals (backticks) can replace parentheses: alert`1`
- Context matters: The bypass depends on WHERE your input lands
- WAFs aren't perfect: Try multiple techniques, they see raw requests