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.
-
User input was placed into a client-side Angular template without sanitising template expressions, so Angular evaluated attacker-controlled expressions.
Seen in 1 report
-
A URL fragment parameter was assigned to innerHTML without encoding or validation.
Seen in 1 report
-
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.
-
A URL parameter was passed straight to jQuery's getScript without validating or restricting the script source.
Seen in 1 report
-
$500 Medium
-
-
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
-
A URL parameter was copied into a link attribute and then built into HTML with jQuery without escaping.
Seen in 1 report
-
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
-
The SDK's setWindowLocation handler assigned the supplied value directly to window.location without checking for a safe protocol.
Seen in 1 report
-
The origin check used a simple string prefix match instead of an exact match.
Seen in 1 report
-
The origin check used a substring match instead of an exact comparison, and message data was passed directly to eval.
Seen in 1 report
-
The deeplink text parameter was inserted into the page without proper HTML encoding or sanitisation.
Seen in 1 report
-
The mermaid diagram renderer did not sanitise click handler URLs, allowing a javascript: scheme as a link target.
Seen in 1 report
-
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
-
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
-
The page inserted the cfg parameter into a script context without escaping the backslash character.
Seen in 1 report
-
The postMessage handler did not validate the message origin and assigned untrusted message data directly to innerHTML.
Seen in 1 report
-
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
-
$3,000 High
-
-
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.
-
Clipboard data was assigned to innerHTML without sanitisation.
Seen in 1 report
-
Medium
-
-
The application inserted the user-supplied filename into HTML without escaping or sanitising it.
Seen in 1 report
-
The outdated Swagger UI page read the configUrl parameter from the URL and used it without proper sanitisation.
Seen in 1 report