Skip to content

In-depth lesson · DOM-based XSS

Root causes

Every point the DOM-based XSS reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 21 of 21
  1. User input was placed into a client-side Angular template without sanitising template expressions, so Angular evaluated attacker-controlled expressions.

    Seen in 1 report
  2. A URL fragment parameter was assigned to innerHTML without encoding or validation.

    Seen in 1 report
  3. A lodash template used for the input modal failed to escape the value parameter for the data-define attribute context, letting an attacker inject into a twine template that was evaluated as JavaScript.

    Seen in 1 report
  4. A URL parameter was passed straight to jQuery's getScript without validating or restricting the script source.

    Seen in 1 report
  5. The application reflected the untrusted X-Forwarded-Host header into page attributes that drive a client-side fetch, and the fetched JSON was written into the DOM without escaping.

    Seen in 1 report
  6. A URL parameter was copied into a link attribute and then built into HTML with jQuery without escaping.

    Seen in 1 report
  7. The message event listener did not verify the sender's origin and passed an attacker-controlled follow-up URL straight into location.href without checking the scheme.

    Seen in 1 report
  8. The SDK's setWindowLocation handler assigned the supplied value directly to window.location without checking for a safe protocol.

    Seen in 1 report
  9. The origin check used a simple string prefix match instead of an exact match.

    Seen in 1 report
  10. The origin check used a substring match instead of an exact comparison, and message data was passed directly to eval.

    Seen in 1 report
  11. The deeplink text parameter was inserted into the page without proper HTML encoding or sanitisation.

    Seen in 1 report
  12. The mermaid diagram renderer did not sanitise click handler URLs, allowing a javascript: scheme as a link target.

    Seen in 1 report
  13. A value from the location hash was passed to a third-party script without sanitising, and the script used it to build JavaScript that was evaluated.

    Seen in 1 report
  14. A third-party script parsed the page URL and referrer into an object without filtering keys such as __proto__, allowing prototype pollution that a gadget later consumed.

    Seen in 1 report
  15. The page inserted the cfg parameter into a script context without escaping the backslash character.

    Seen in 1 report
  16. The postMessage handler did not validate the message origin and assigned untrusted message data directly to innerHTML.

    Seen in 1 report
  17. The mermaid library merged user-supplied directive values into CSS without sanitisation and inserted the styles into the DOM using innerHTML.

    Seen in 1 report
  18. The deparam function assigned user-controlled keys from the URL fragment into nested objects without blocking prototype-related property names, and a gadget passed the inherited value to eval.

    Seen in 1 report
  19. Clipboard data was assigned to innerHTML without sanitisation.

    Seen in 1 report
  20. The application inserted the user-supplied filename into HTML without escaping or sanitising it.

    Seen in 1 report
  21. The outdated Swagger UI page read the configUrl parameter from the URL and used it without proper sanitisation.

    Seen in 1 report