In-depth lesson · XSS
Bypasses and variations
Every point the XSS reports back under this heading, best-backed first, each with the reports it is seen in.
-
Validation only checked the first request's image header while the second request accepted any content.
Seen in 1 report
-
Vary case to get past a case-sensitive blocklist of a literal keyword, and use an alternative to the stripped plus character.
Seen in 1 report
-
Varying event-handler syntax so a naive sanitiser misses it.
Seen in 1 report
-
When a CSP includes 'unsafe-inline', inline scripts execute despite the policy.
Seen in 1 report
-
When a default-src 'self' CSP blocks inline script, upload a JavaScript file to the same origin and load it through the injected username.
Seen in 1 report
-
When a firewall blocks script tags, try other HTML markup such as headings to confirm HTML injection.
Seen in 1 report
-
When a reflected value has its first letter capitalised, use HTML numeric character references for the function name.
Seen in 1 report
-
When a script tag is blocked, use an SVG onload handler or an image onerror handler to execute.
-
When a script tag is rendered as text, break out of the attribute context to execute instead.
Seen in 1 report
-
When a script tag payload is blocked by a CDN WAF, break out of the JavaScript string context instead of using tags.
Seen in 1 report
-
When a strict CSP blocks inline scripts, use an iframe srcdoc that loads a whitelisted JSONP endpoint to execute script.
Seen in 1 report
-
When a WAF blocks a basic script payload, try alternative tag types and encodings until one is not blocked.
Seen in 1 report
-
When a WAF blocks a fixed keyword list, reach DOM access through built-in objects such as print and console.
Seen in 1 report
-
When a WAF blocks certain tags and event handlers on the 404 page, experiment with different tags and event handlers to get past it.
-
When a WAF blocks ordinary payloads, use a body background attribute pointing at your own listener to make the browser issue a request the WAF does not cover.
Seen in 1 report
-
When alert, prompt and confirm are blocked, use their uppercase forms, which are allowed and lowercased before evaluation.
Seen in 1 report
-
When an image onerror payload failed, Base64-encode the payload and try again.
-
When angle brackets are filtered, use a javascript: URL in the callback parameter instead of an XSS payload.
Seen in 1 report
-
When Cloudflare blocks simple payloads, try crafted tag variants until one passes.
Seen in 1 report
-
When CSP blocks inline script, demonstrate script-less impact such as an open redirect or a fake download prompt from injected markup.
Seen in 1 report
-
When iframe, script and img tags are blocked, try an object tag pointing at attacker-controlled content.
Seen in 1 report
-
When inline event handlers are blocked by CSP, use an iframe to isolate the script tag hook and bypass the policy.
Seen in 1 report
-
When inline script payloads only produce a blank popup, dangling markup with a CSS import and a broken image can still achieve HTML injection.
-
When input is converted to uppercase, build a payload using only uppercase letters and symbols.
Seen in 1 report
-
When only lowercase script tags are blocked, submit the same payload with mixed-case letters in the tag.
Seen in 1 report
-
When payloads containing alert are blocked, use an anchor tag with a confirm handler instead.
Seen in 1 report
-
When script and image tags were blocked, an event handler with a closing quote and a style attribute covering the page triggered execution.
Seen in 1 report
-
When script tags and most event handlers are blocked by a WAF, try the onpointerenter event and a body tag.
Seen in 1 report
-
When script tags are blocked by sandboxing, use a payload that reads document.cookie and localStorage.
-
When session cookies are HttpOnly and SameSite, chain injected script with same-site settings endpoints and the XSRF token instead of reading the cookie.
Seen in 1 report
-
When session cookies are HttpOnly, use the XSS to call a same-origin JSON email-change endpoint and then trigger a password reset.
Seen in 1 report
-
When the application escapes angle brackets, submit a hex-encoded script that the browser decodes.
Seen in 1 report
-
When the original page is blocked by same-origin framing headers, use directory discovery to find another page that hosts the same listener without the framing restriction.
Seen in 1 report
-
When the payload was blocked by CSP, a script was loaded from a video platform's oEmbed endpoint to bypass the policy.
-
When the server encodes a double quote to its percent form, use mixed case in the event handler name to bypass filtering.
Seen in 1 report
-
When the session cookie is HttpOnly, chain the stored XSS with a DOM XSS to inject a fake login page on the same domain and capture credentials.
Seen in 1 report
-
When the session cookie is HttpOnly, use the victim's browser to fetch an API endpoint returning session data and exfiltrate it.
Seen in 1 report
-
Where a less-than sign is blocked, break out of an HTML attribute and add an event handler instead.
Seen in 1 report
-
With HTML injection on a strict-CSP site, use a same-origin JSONP endpoint and Same Origin Method Execution to click buttons and run actions.
Seen in 1 report
-
Work around a WAF and a block on alert-style functions using obfuscated tag and string variants.
-
Work around length limits, uppercasing, line breaks and escaped characters by loading an external stylesheet or script.
Seen in 1 report
-
Wrap a base64-encoded image onerror payload in a hyperlink to get past editor filtering.
Seen in 1 report
-
Wrap the crafted endpoint request in a clickjacking page that overlays a button so the victim clicks through to the redirect.
Seen in 1 report