In-depth lesson · XSS
Root causes
Every point the XSS reports back under this heading, best-backed first, each with the reports it is seen in.
-
The runtime trusted a request parameter to choose where theme and styling resources were loaded from, without restricting allowed hosts.
Seen in 1 report
-
The same value was interpreted as a string for the hostname check and as an options object for the postMessage targetOrigin due to JavaScript overload resolution.
Seen in 1 report
-
The sandbox blocked direct access to Facebook-rendered elements, but DOM traversal from an app-owned wrapper reached them anyway.
Seen in 1 report
-
The sandbox iframe had allow-popups and allow-popups-to-escape-sandbox, and the JavaScript override of window.open could be bypassed via a nested iframe's contentWindow.open.
-
The sandbox parser and rewriter did not recognise newer ECMAScript constructs, so their constructors or import calls were not replaced with sandboxed versions.
Seen in 1 report
-
The sandbox's variable-name filtering did not decode Unicode escape sequences before checking forbidden identifiers.
Seen in 1 report
-
The sanitisation decision compared the field name case-sensitively against a fixed list, so a differently-cased or padded name skipped sanitisation while still updating the same database column.
Seen in 1 report
-
The sanitiser and browser parsed noscript and svg or math with style differently, so cleaned output was re-interpreted as executable markup.
Seen in 1 report
-
The sanitiser blocked plain javascript: URLs but not ones containing encoded control characters.
Seen in 1 report
-
The sanitiser built an inline CSS background-image rule from the body's background attribute without quoting the value.
Seen in 1 report
-
The sanitiser called the shortcode processor before stripping tags and shortcode syntax.
-
The sanitiser cleaned a browser-generated clone of the selected option but did not re-sanitise it after the browser refreshed that clone from the original option.
Seen in 1 report
-
The sanitiser compared the whole trimmed property value against 'fixed', so any value with extra tokens such as !important skipped the mitigation.
-
The sanitiser did not account for node types such as processing instructions and CDATA sections that XML and HTML parsers treat differently.
Seen in 1 report
-
The sanitiser did not handle certain HTML nodes such as CDATA sections.
Seen in 1 report
-
The sanitiser did not treat same-origin SVG use elements as dangerous even though Firefox executes script from them.
Seen in 1 report
-
The sanitiser does not strip arbitrary data attributes that the site's JavaScript uses to choose request endpoints.
Seen in 1 report
-
The sanitiser marked output as safe HTML, letting certain tags such as links render.
-
The sanitiser matched the literal string javascript: before the browser decoded HTML entities.
Seen in 1 report
-
The sanitiser parsed with the fragment algorithm while the sink re-parsed with the document algorithm, and they disagreed on SVG foreign content.
Seen in 1 report
-
The sanitiser processed SVG content in SVG context then renamed the outer element, causing the browser to reinterpret the content.
Seen in 1 report
-
The sanitiser removed the inner script substring only once, so a nested tag reassembled into a working script tag after cleaning.
Seen in 1 report
-
The sanitiser replaced anchor tags with placeholders before escaping, then reinserted them, letting an attacker break out of an HTML attribute.
Seen in 1 report
-
The sanitiser unescaped HTML entities before stripping tags.
-
The sanitiser used a blocklist that did not account for plus signs inside tags, so the browser still parsed the modified tags.
-
The sanitiser used a prefix-sensitive equality check on element names instead of a prefix-insensitive match, so prefixed elements were not recognised and their javascript: URLs were not stripped.
Seen in 1 report
-
The sanitiser trusted a property on the node itself as a marker that it had already been cleaned, and DOM clobbering let an attacker-controlled child satisfy that check for its parent.
Seen in 1 report
-
The sanitiser used a single-pass string replacement that could be defeated by nesting the dangerous pattern.
-
The sanitiser validated pasted HTML before the browser parser mutated it into a different executable DOM structure.
Seen in 1 report
-
The sanitiser's allow-list let SMIL values and by attributes through without URI validation, and its animation block only covered href.
-
The sanitiser's allow-list permitted arbitrary class attributes on code and pre elements, and in some products further transformations ran after sanitisation.
Seen in 1 report
-
The sanitiser's attribute allow and deny logic missed attributes that browsers can still act on.
Seen in 1 report
-
The sanitiser's comment regular expression only matched the standard comment ending and missed alternative endings that browsers accept.
-
The sanitiser's protection logic could be tricked by a special string and a data attribute that disabled filtering.
-
The redirect sanitiser did not block javascript: URLs and the home page did not sanitise the parameter at all.
-
The sanitiser allowed a use element to reference a data URI without inspecting the embedded SVG content.
Seen in 1 report
-
The Sanitizer API's baseline-unsafe element list omits the base element, so a custom configuration that allows it lets an injected base element change URL resolution for the whole document.
Seen in 1 report
-
The sanitiser validates tags and attributes but not URL schemes in href or src, and the app has no Content-Security-Policy.
Seen in 1 report
-
The save endpoint lacked a CSRF token check and stored action names were output without HTML encoding.
-
The scanned URL was inserted with innerHTML without escaping, unlike other fields on the page.
Seen in 1 report
-
The scanner validates with a URL parser that strips only ASCII whitespace while the Omnibox strips Unicode whitespace, so a leading ideographic space hides the scheme.
Seen in 1 report
-
The scheme validation is not atomic with the navigation it guards, creating a time-of-check-to-time-of-use race.
Seen in 1 report
-
The scraping library returned metadata unsanitised and the example app inserted it into HTML unescaped.
Seen in 1 report
-
The script parsed the page URL and referrer into an object without filtering keys such as __proto__, allowing prototype pollution.
Seen in 1 report
-
The search group name was stored and rendered into the discount page without output encoding, and target fields were trusted from the request.
Seen in 1 report
-
The search input was reflected into the page without output encoding.
Seen in 1 report
-
The search input was sanitised by a custom filter that failed to decode HTML entities before checking for dangerous characters, and the site lacked X-Frame-Options and the HttpOnly cookie flag.
-
The search page inserted the user query into the DOM without encoding.
Seen in 1 report
-
The search parameter echoed into an attribute without attribute-safe escaping.
-
The search parameter was inserted into an HTML attribute without context-aware encoding.
Seen in 1 report