Skip to content

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.

Back to the lesson 701 to 743 of 743
  1. Validation only checked the first request's image header while the second request accepted any content.

    Seen in 1 report
  2. 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
  3. Varying event-handler syntax so a naive sanitiser misses it.

    Seen in 1 report
  4. When a CSP includes 'unsafe-inline', inline scripts execute despite the policy.

    Seen in 1 report
  5. 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
  6. When a firewall blocks script tags, try other HTML markup such as headings to confirm HTML injection.

    Seen in 1 report
  7. When a reflected value has its first letter capitalised, use HTML numeric character references for the function name.

    Seen in 1 report
  8. When a script tag is blocked, use an SVG onload handler or an image onerror handler to execute.

    Seen in 1 report
  9. When a script tag is rendered as text, break out of the attribute context to execute instead.

    Seen in 1 report
  10. 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
  11. When a strict CSP blocks inline scripts, use an iframe srcdoc that loads a whitelisted JSONP endpoint to execute script.

    Seen in 1 report
  12. When a WAF blocks a basic script payload, try alternative tag types and encodings until one is not blocked.

    Seen in 1 report
  13. When a WAF blocks a fixed keyword list, reach DOM access through built-in objects such as print and console.

    Seen in 1 report
  14. When a WAF blocks certain tags and event handlers on the 404 page, experiment with different tags and event handlers to get past it.

    Seen in 1 report
  15. 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
  16. When alert, prompt and confirm are blocked, use their uppercase forms, which are allowed and lowercased before evaluation.

    Seen in 1 report
  17. When an image onerror payload failed, Base64-encode the payload and try again.

    Seen in 1 report
  18. When angle brackets are filtered, use a javascript: URL in the callback parameter instead of an XSS payload.

    Seen in 1 report
  19. When Cloudflare blocks simple payloads, try crafted tag variants until one passes.

    Seen in 1 report
  20. 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
  21. When iframe, script and img tags are blocked, try an object tag pointing at attacker-controlled content.

    Seen in 1 report
  22. 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
  23. When inline script payloads only produce a blank popup, dangling markup with a CSS import and a broken image can still achieve HTML injection.

    Seen in 1 report
  24. When input is converted to uppercase, build a payload using only uppercase letters and symbols.

    Seen in 1 report
  25. When only lowercase script tags are blocked, submit the same payload with mixed-case letters in the tag.

    Seen in 1 report
  26. When payloads containing alert are blocked, use an anchor tag with a confirm handler instead.

    Seen in 1 report
  27. 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
  28. When script tags and most event handlers are blocked by a WAF, try the onpointerenter event and a body tag.

    Seen in 1 report
  29. When script tags are blocked by sandboxing, use a payload that reads document.cookie and localStorage.

    Seen in 1 report
  30. 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
  31. 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
  32. When the application escapes angle brackets, submit a hex-encoded script that the browser decodes.

    Seen in 1 report
  33. 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
  34. When the payload was blocked by CSP, a script was loaded from a video platform's oEmbed endpoint to bypass the policy.

    Seen in 1 report
  35. 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
  36. 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
  37. 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
  38. Where a less-than sign is blocked, break out of an HTML attribute and add an event handler instead.

    Seen in 1 report
  39. 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
  40. Work around a WAF and a block on alert-style functions using obfuscated tag and string variants.

    Seen in 1 report
  41. Work around length limits, uppercasing, line breaks and escaped characters by loading an external stylesheet or script.

    Seen in 1 report
  42. Wrap a base64-encoded image onerror payload in a hyperlink to get past editor filtering.

    Seen in 1 report
  43. 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