Abstract
Cross-site scripting (CWE-79) has been publicly described for a quarter of a century. Mainstream template engines escape output by default, and browsers offer Content Security Policy, Trusted Types and a built-in HTML sanitiser, yet XSS still tops MITRE’s weakness ranking. Why do the defences leave so much uncovered? A web page mixes several grammars, and each defence covers only some of them. Auto-escaping protects the contexts its authors anticipated, while raw-output escape hatches, unusual contexts and small bugs in framework helpers fall outside it, as two framework fixes of November and December 2026 show. Sanitisers can be undone when their output is changed, moved or parsed again. Host allowlists in Content Security Policy were mostly bypassable in a large 2016 study, and code already trusted by a page can weaken the nonce-based replacement. Trusted Types restricts DOM injection sinks for sites that opt in, but does not address server-side injection. The controls fit different application designs, and none removes the need for reviewed exceptions, isolated origins for user content and prompt framework patching.
A bug that has outlived its explanation
MITRE defines CWE-79 as a product that “does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users”.1 It is the browser-side cousin of SQL and command injection, covered in Data that becomes code: external data reaches an interpreter and is read as instructions. Here the interpreter is the browser, and a single HTML document contains several languages at once, each with its own parser and its own idea of where a string ends.
The class is old. CERT/CC’s advisory CA-2000-02, “Malicious HTML Tags Embedded in Client Web Requests”, first released on 2 February 2000, warned that “a web site may inadvertently include malicious HTML tags or script in a dynamically generated page based on unvalidated input from untrustworthy sources”.2 Lekies, Kotowicz, Groß, Vela Nava and Johns opened their 2017 paper with the observation that “since its initial public documentation in 2000 until now, XSS has been continuously on top of the vulnerability statistics”.3
It is still there. In MITRE’s 2025 CWE Top 25, the latest edition as of 4 December 2026, CWE-79 ranks first with a score of 60.38, the same rank as the year before; seven of the CVEs mapped to it in that dataset are in CISA’s Known Exploited Vulnerabilities catalogue.4 The dataset is 39,080 CVE records for vulnerabilities published between 1 June 2024 and 1 June 2025; the Top 25 team remapped records with imprecise weakness information before applying a scoring formula that combines frequency and severity.5 The CVE, CWE and CAPEC article explains that score, and why a high rank can coexist with falling incidence.
OWASP’s Top 10 keeps cross-site scripting inside its Injection category. The 2021 edition placed Injection third; the 2025 edition places it fifth, as A05.67 The 2025 category page says, of its own dataset, that injection “includes Cross-site Scripting (high frequency/low impact) with more than 30k CVEs and SQL Injection (low frequency/high impact) with more than 14k CVEs”, and that the volume of CWE-79 records “brings down the average weighted impact of this category”.7 Both the 30,000 figure and the frequency and impact labels describe OWASP’s corpus, not one year’s output and not the consequences of any particular flaw.
What the counts measure
Counting XSS is harder than the rankings suggest. On 4 December 2026 (UTC) I queried the National Vulnerability Database’s CVE API 2.0 for records published in calendar year 2025, in four windows: 1 January to 30 April, 1 May to 28 August, 29 August to 26 December, and 27 to 31 December, all UTC.
| Query | Jan–Apr | May–Aug | Aug–Dec | 27–31 Dec | 2025 total |
|---|---|---|---|---|---|
| All CVE records | 16,554 | 15,473 | 17,080 | 865 | 49,972 |
cweId=CWE-79 | 395 | 306 | 166 | 8 | 875 |
| Exact phrase “cross-site scripting” | 1,195 | 1,233 | 1,312 | 15 | 3,755 |
The three queries used the same template, https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=1&pubStartDate=START&pubEndDate=END, with no further parameter for the first row, &cweId=CWE-79 added for the second, and &keywordSearch=cross-site%20scripting&keywordExactMatch added for the third; each cell is the totalResults value returned. The footnotes link the first window of each row; the other windows change only the two dates.8910 The second row counts records returned for that weakness filter and the third counts records whose text matches the phrase. Incomplete or differing weakness mappings and the wording of descriptions are possible contributors to the fourfold gap; I did not compare the returned records, so the cause is not established, and neither figure is offered as the 2025 count. The Top 25’s remapped dataset is the more defensible basis for ranking.5
A single vendor roundup shows what one ecosystem’s reporting looks like. Sucuri’s roundup for November 2026, a curated list of WordPress plugin and theme fixes published on 30 November 2026, contains 484 entries by my count. 238 entries are labelled as cross-site scripting: 223 stored, 15 reflected, and 5 of these labelled DOM-based. In 113 of the 238, the vulnerability label begins “Unauthenticated”, including three separate unauthenticated stored XSS entries for LiteSpeed Cache up to version 7.9.3, which Sucuri lists with more than 7,000,000 installations.11 The roundup is Sucuri’s selection; it gives no denominator across ecosystems and does not say whether each entry received a CVE. The CMS extension ecosystems article discusses why plugin directories produce so many such reports.
HackerOne reports a different trend on its own platform. Its November 2025 blog post reports Luke Stephens, who hosted its panel on the 2025 report, as saying that common XSS bugs found by researchers are declining in number for the first time; its January 2026 post said that traditional issues such as XSS had declined from their 2024 peak.1213 The January post also said that “78% of valid hackbot findings were XSS”.13 That denominator is valid findings by automated hackers on HackerOne. Neither post gives an XSS-only time series, and both are one vendor’s statements about its own programmes.
Three names, two axes
OWASP’s page “Types of Cross-Site Scripting” sets out the taxonomy used here. It describes reflected XSS as input “immediately returned by a web application in an error message, search result, or any other response”, and stored XSS as input “stored on the target server, such as in a database, in a message forum, visitor log, comment field” and later served to a victim. In 2005 Amit Klein named a third type, DOM-based XSS, in which “the page itself (the HTTP response that is) does not change, but the client side code contained in the page executes differently” because of attacker-controlled values in the DOM environment.14
The same page argues that the three types overlap, and says that from about mid-2012 researchers began to use a second axis. Server XSS is where untrusted data “is included in an HTTP response generated by the server”; Client XSS is where untrusted data “is used to update the DOM with an unsafe JavaScript call”. Either can be reflected or stored, which gives a two-by-two matrix, and DOM-based XSS becomes “a subset of Client XSS, where the source of the data is somewhere in the DOM”.14
| Server XSS (the server builds the bad HTML) | Client XSS (page script builds it) | |
|---|---|---|
| Reflected | A search page echoes q into the response | Page script reads location.hash and writes it with innerHTML |
| Stored | A comment is saved and later rendered unescaped | A JSON API returns a saved comment and page script inserts it as HTML |
The examples in the table are illustrative. Other sources draw the line differently. The Trusted Types specification frames DOM XSS as attacker-controlled data reaching DOM injection sinks, and Google’s 2021 report uses the term in the same setting.1516 On my reading, that usage is closer to OWASP’s Client XSS than to its narrower DOM-based XSS, which is defined by where the data comes from; Google’s DOM XSS figures below are read in that sense.
The distinction matters because the defences divide along the same line. OWASP’s recommended defence for Server XSS is “context-sensitive server side output encoding”; for Client XSS it is “using safe JavaScript APIs”.14 Template auto-escaping does nothing for a bug that happens after the page has loaded, and Trusted Types, as its specification says, does not try to fix injections “into server-side generated markup”.15 For Google’s own reward programme, Krzysztof Kotowicz’s mid-2021 report states that “DOM XSS consistently accounts for >50% XSSes reported to Google VRP”.16 That is one company’s programme; the report gives no industry-wide trend.
What a script in the page can do
The same-origin policy is “a critical security mechanism that restricts how a document or script loaded by one origin can interact with a resource from another origin”.17 Injected script runs in the vulnerable page’s origin, so the policy does not separate it from the page’s own scripts. CWE lists the effects as reading application data, bypassing protection mechanisms and executing unauthorised commands, and describes the attacker’s script performing “some activity on behalf of the victim”, which “could be especially dangerous to the site if the victim has administrator privileges”.1 OWASP’s description runs from “an annoyance to complete account compromise”.18 Samy Kamkar’s account of his 2005 worm, below, shows the mechanics: the script read the page’s own markup to find the viewer’s identifier and a confirmation token, then sent requests that the browser accompanied with the user’s cookies.19
HttpOnly limits theft, not action
The classic demonstration reads document.cookie. The HttpOnly attribute stops script from reading the cookie it marks: MDN says it “forbids JavaScript from accessing the cookie”, then adds that such a cookie “will still be sent with JavaScript-initiated requests, for example, when calling XMLHttpRequest.send() or fetch()“.20 On an ordinary page loaded at the top level, a payload’s requests back to that page’s own site therefore carry whatever cookies apply to them, when the request includes credentials, even though the payload cannot read them. HttpOnly protects only the cookies it marks; other credentials the page can read, such as tokens rendered into the DOM, are not covered. CWE calls HttpOnly “not a complete solution” and rates it as defence in depth.1 SameSite, which MDN describes as controlling “whether or not a cookie is sent with cross-site requests”, restricts cross-site requests; in that ordinary top-level case, the payload’s requests to its own site are not cross-site, so it does not restrict them.20
OWASP’s CSRF cheat sheet is blunt about the related control: “Remember that Cross-Site Scripting (XSS) can defeat all CSRF mitigation techniques!” It still recommends CSRF tokens for cookie-authenticated applications, since they address a different attack.21 The session token theft article makes the parallel point about token binding: binding a token to a key defeats copying, not misuse in place.
Samy, 2005
Samy Kamkar’s first-person account of his MySpace worm records releasing the code at 12:34 pm on “10/04” (4 October 2005) with 73 friends, and, “in less than 20 hours”, a count of 1,005,831.22 His technical write-up describes a site that filtered profile content with a blocklist of tags, attributes and words, and a worm that relied on browser parsing leniency of the time to get past each rule. The script then read the page it was running in, used the browser’s own requests, which carried the session cookies, and retrieved the confirmation token a form required before submitting it. Each infected profile carried the code to everyone who viewed it.19 The trust boundaries involved recur throughout this article: a filter that predicted the browser’s parsing incorrectly, a token readable by same-origin script, and stored content rendered in other users’ sessions. CWE cites the worm in its own entry as an example of XSS and CSRF combining.1
Escaping: the right idea in too many grammars
Output escaping turns characters that have syntactic meaning into inert representations. Django’s template engine, by default, escapes five characters in every variable tag: <, >, ', " and &.23 Laravel’s Blade sends {{ }} echoes “through PHP’s htmlspecialchars function to prevent XSS attacks”.24 OWASP’s cheat sheet recommends HTML entity encoding for values placed in an HTML context, and explains that different encoding methods exist because “browsers parse HTML, JS, URLs, and CSS differently”, and that the wrong method may introduce weaknesses.25 HTML escaping fits text between tags and quoted values of inert attributes; it is not the right encoding for a value that is itself a URL, a style or script.
Contexts the escaper did not expect
The difficulty is that “the page” is several contexts, and the safe encoding depends on which one the value lands in. OWASP’s prevention cheat sheet tells developers to surround attribute values with double or single quotation marks, and lists dangerous contexts where “output encoding is not perfect”: directly inside a <script> block, inside an HTML comment, directly in CSS, as an attribute name or a tag name, and in places where URLs are handled such as CSS url() values.25
Django’s security documentation gives a concrete case its own escaping does not cover:
<style class={{ var }}>...</style>If var is class1 onmouseover=javascript:func(), the documentation says, “this can result in unauthorized JavaScript execution, depending on how the browser renders imperfect HTML. (Quoting the attribute value would fix this case.)”26 None of the five escaped characters is needed to break out of an unquoted attribute; a space is enough.
URLs are the other recurring gap. HTML-escaping javascript:alert(1) changes nothing, because it contains no special HTML characters, and a link with that href runs script when clicked. React began warning about javascript: URLs in version 16.9 in August 2019, saying they are “a dangerous attack surface because it’s easy to accidentally include unsanitized output in a tag like <a href>“, and that a future major release would throw an error.27 OWASP’s cheat sheet records that “React 19 blocks javascript: URLs in src and href“, and adds that this “does not replace application-specific URL validation”.25 An allowlist of schemes (https:, mailto:) is still the application’s job.
JavaScript contexts are a third. OWASP’s cheat sheet treats a value inside a quoted JavaScript string in a script block as needing JavaScript encoding, a different method from HTML entity encoding, and lists direct placement inside a <script> block among the dangerous contexts; its advice is not to place variables there at all.25 Where data must reach a script, a serialiser built for embedding in HTML, such as Django’s json_script, is the safer route (see the recommendations below).28
The escape hatches
Each of the four frameworks discussed here provides a documented way around its default protection, because applications sometimes need to render HTML:
- Blade.
{!! $name !!}prints without escaping. Laravel’s documentation says: “Be very careful when echoing content that is supplied by users of your application.”24 - Django. The
safefilter,mark_safe()and{% autoescape off %}all bypass escaping, and the security guide asks developers to be “particularly careful when usingis_safewith custom template tags, thesafetemplate tag,mark_safe, and when autoescape is turned off”.26 Django’s utilities reference adds that a “String marked safe will become unsafe again if modified”, and recommendsformat_html()for building fragments.29 - React.
dangerouslySetInnerHTML“overrides theinnerHTMLproperty of the DOM node”; the reference says “unless the markup is coming from a completely trusted source, it is trivial to introduce an XSS vulnerability this way”.30 - Angular. Angular works differently from a server template escaper. It “sanitizes untrusted values for HTML and URLs”, depending on the security context of the binding, and notes that “sanitizing resource URLs isn’t possible because they contain arbitrary code”. The
bypassSecurityTrustHtml,bypassSecurityTrustScript,bypassSecurityTrustStyle,bypassSecurityTrustUrlandbypassSecurityTrustResourceUrlmethods mark a value as trusted so that Angular does not sanitise it, telling Angular “that you inspected a value, checked how it was created, and made sure it is secure”.31
OWASP’s cheat sheet lists these with others it names for Lit and Polymer, under “escape hatches that frameworks use to directly manipulate the DOM”.25 The hatch itself is not the bug; the bug is an untrusted value that reaches it. Each hatch is a place where the framework’s guarantee becomes a reviewer’s judgement.
November and December 2026: two framework fixes
Two recent fixes show the boundary from the framework side. In both, escaping was switched on and a path through the framework did not apply it.
On 2 December 2026 the Django team issued 6.1.4, 6.0.11 and 5.2.20. Among the issues fixed is CVE-2026-115868, rated moderate under Django’s policy. The advisory says the truncatechars_html filter and Truncator.chars() with html=True “were subject to a potential cross-site scripting (XSS) attack when certain inputs whose text length matched the truncation length were processed and rendered in an HTML attribute”.32
The change to production code is one line, accompanied by a regression test. Django’s HTML truncator parses its input with Python’s HTMLParser, with character references converted to characters, and escapes text as it writes it out. One branch was taken when the number of characters processed equalled the truncation length exactly and the length of the output so far plus the current text equalled the length of the raw input; that branch appended the text without escaping it. The patch changes self.output.append(data) to self.output.append(escape(data)), and the new test expects Truncator('"ab"').chars(4, html=True) to return "ab".33 Before the fix, the quotes came back raw, and inside a quoted attribute a raw " ends the attribute, which matches the context the advisory names. This reading of the code is mine; the advisory states only the length condition and the attribute context.
Laravel’s case was disclosed earlier. On 18 November 2026 the laravel/framework repository published GHSA-9966-43cq-4mpr (CVE-2026-142638). Blade’s <x-dynamic-component> “did not HTML-escape bound attributes (:attr="$value") when the target resolved to a class-based component”. User data bound to an attribute that was not a constructor parameter, in a component printing {{ $attributes }}, “could break out of the HTML attribute and lead to cross-site scripting”. The same component rendered with its normal tag escaped the value correctly, and anonymous components were not affected. The advisory lists the 13.x branch as fixed in 13.43.0 and the 12.x branch as fixed in 12.73.0, and notes that compiled views keep the old behaviour until they are recompiled with php artisan view:clear or view:cache.34 The release notes for v13.43.0 and v12.73.0, both published on 17 November 2026, include the two linked fixes, “Render bound attributes of dynamic class components like the component tag”.3536
The repository’s advisory list shows five advisories published on 2 December 2026.37 One concerns escaping. GHSA-58jq-583v-r2jw says that when Markdown::withSecuredEncoding() is enabled, values echoed with {{ }} in Markdown mail templates “are not escaped for double quotes, single quotes or ampersands”, so a value inside an HTML attribute “can break out of it and inject additional attributes into the email”. That is HTML attribute injection into an email; the advisory adds that it “leads to XSS where the mailable is rendered in a context that executes script”. It lists the 13.x branch as fixed in 13.44.1 and the 12.x branch in 12.74.0.38
Exposure followed each advisory’s own conditions. Django applications were affected where the filter’s output met the length condition and was rendered in an attribute, until upgraded.32 Laravel applications were affected by the Blade issue where user data was bound to a non-constructor attribute of a dynamic component resolving to a class-based component, until upgraded and their compiled views recompiled;34 and by the Markdown mail issue only where withSecuredEncoding() was enabled and user data was rendered inside an attribute in a mail template.38
Sanitisers and the parser that has the last word
For plain text, escaping remains the right tool. When a feature must keep some of the user’s markup, such as a rich-text comment, an email body or a CMS field, escaping would display the tags instead of rendering them, and OWASP recommends HTML sanitisation for that case.25 A sanitiser parses the HTML, removes what is not on an allowlist, and returns the rest. OWASP recommends DOMPurify and warns: “If you sanitize content and then modify it afterwards, you can easily void your security efforts.” It adds: “You must regularly patch DOMPurify or other HTML Sanitization libraries that you use. Browsers change functionality and bypasses are being discovered regularly.”25
Mutation XSS
Heiderich, Schwenk, Frosch, Magazinius and Yang’s CCS 2013 paper, “mXSS Attacks”, explains why. Server- and client-side filters, they wrote, “share the assumption that their HTML output and the browser-rendered HTML content are mostly identical”. With innerHTML that assumption fails: a string that passes the filter “is subsequently transformed into an active XSS attack vector by the browser layout engine itself”.39 The paper’s earliest example came from Hasegawa’s 2007 analysis of a bug in one browser, in which reading markup back through innerHTML changed how attribute values were delimited, so that a string which had been inert became active when parsed again. The paper described seven subclasses of mutation XSS, “among which only one was previously known”, and reported bypasses of HTML Purifier, kses, htmlLawed, Blueprint and Google Caja, of browser XSS filters and of WAFs, with stored vectors placed in Yahoo! Mail and other webmail clients.39 The site’s language-theoretic security article treats the general pattern of components that read the same input differently.
DOMPurify in 2026
DOMPurify is the actively maintained client-side sanitiser that OWASP recommends. Its repository’s advisory list shows 27 security advisories published in 2026, from 25 March to 23 November: 13 rated low, 13 moderate and one high.40 Three of them show three different ways a sanitised result can stop being safe:
- Reparsing in a new context (March 2026). Fluid Attacks reported that sanitised output, when concatenated into a wrapper string such as
<xmp> ... </xmp>or other special wrappers and then reparsed by the browser, could mutate into executable markup. The wrappers named arescript,xmp,iframe,noembed,noframesandnoscript. The trust boundary is the application’s string handling after sanitisation.41 - Browser-driven DOM change during sanitisation (May 2026, CVE-2026-47423, high). In DOMPurify 3.4.4, the browser refreshed the contents of a newly added HTML element,
selectedcontent, after DOMPurify had already walked that part of the tree, so the returned string could contain unsanitised markup that executed when the application inserted it. The reporter reproduced it in Chromium and a WebKit build, not in Safari or Firefox.42 - Later template compilation (November 2026, CVE-2026-144292). With
SAFE_FOR_TEMPLATES, an option meant to strip{{ }}for client-side template engines, nested<form>elements produced output containing no{{, yet which “becomes a live{{…}}expression as soon as it is assigned toinnerHTML“. The reporter verified execution when Vue 3 and AngularJS 1.8.3 then compiled the DOM.43
Each shows that a sanitiser’s result is safe for the insertion it was designed for, and not necessarily after later string handling, browser behaviour the sanitiser did not anticipate, or a second interpreter. A 2024 advisory (CVE-2024-47875) for nesting-based mXSS, rated critical, is an older case.44
The HTML Sanitizer API
The platform response is to have the browser sanitise during parsing. In the WHATWG HTML standard, element.setHTML(html, options) “parses html using the HTML parser”, using the element as parsing context, sanitises the markup “as it is parsed” according to the sanitizer option, and replaces the element’s children with the result.45 For direct insertion into its target element, in conforming implementations, this removes the application-managed handoff of a sanitised string to a separate parse. It cannot make the content safe after later transformations by the application. According to MDN’s browser compatibility data, Chrome has shipped setHTML() and the Sanitizer interface since version 146 and Firefox since 148; Safari has not shipped them, and WebKit tracks the work in bug 303808.4647 Firefox’s release notes for version 148, released on 24 February 2026, describe setHTML() as inserting HTML “similarly to element.innerHTML, but without the security vulnerabilities such as cross-site scripting (XSS)”.48
Implementations are still converging. The compatibility data records that Chrome sanitised after parsing rather than during it before version 152, and Firefox before version 159; that in Chrome before 153 “the <base> element was not removed from a configuration’s allowlist”, which could manipulate a document’s relative URLs; and the same note for current Firefox.46 On my reading of that note, the risk arises when a custom configuration lists <base>, so custom allowlists in affected versions should not include it. Where safe setHTML() is unavailable, a maintained library remains the fallback, applied with the receiving context in mind.
Content Security Policy: from allowlists to nonces
Content Security Policy is the browser-enforced second line: a response header telling the browser which scripts may run. Host allowlists such as script-src 'self' cdn.example.com were the form measured in Google’s 2016 study.
Why allowlists failed
Weichselbaum, Spagnuolo, Lekies and Janc’s CCS 2016 paper, “CSP Is Dead, Long Live CSP!”, measured policies in Google’s search-engine corpus of about 100 billion pages. They found CSP on 1,680,867 hosts with 26,011 unique policies. Their abstract reports bypasses in 94.72% of all distinct policies; separately, 94.68% of policies that attempted to limit script execution were ineffective, and “99.34% of hosts with CSP use policies that offer no benefit against XSS”. 14 of the 15 domains most commonly allowlisted for scripts “contain unsafe endpoints”, and 75.81% of distinct policies used script allowlists that allowed attackers to bypass CSP.49 The watering holes and third-party scripts article discusses the same paper from the other direction, where the allowlisted vendor is itself compromised.
The paper explains the mechanisms, each of which assumes an injection point on the page and a suitable script resource served from a permitted source. One is a JSONP endpoint on an allowed host that lets the caller choose the callback name: loaded as a script, it can execute attacker-chosen functions, with full script execution if the attacker controls the start of the response, and more constrained but often comparable effects if only a function name is allowed. Another is a library such as AngularJS on an allowed host, whose template evaluation, including its “CSP compatibility mode”, can run attacker-controlled expressions.50 The defensive lesson is that a broad host expression permits every script resource on that host that matches it. CSP3 also allows source expressions with a path component, which narrows the match subject to its matching rules, but a policy still trusts whatever script the matching URLs serve.51
Strict CSP
The authors proposed the 'strict-dynamic' keyword with cryptographic nonces in place of allowlists.49 Google’s guidance on web.dev gives this policy:
Content-Security-Policy:
script-src 'nonce-{RANDOM}' 'strict-dynamic';
object-src 'none';
base-uri 'none';Under this policy, the scripts the server writes into the page must carry the nonce or, in the hash-based variant, match a listed hash. Inline event handlers and javascript: URIs are blocked and have to be refactored. Google recommends the hash-based variant for pages served statically or that need to be cached.52 The CSP Level 3 specification, a W3C Working Draft dated 27 October 2026, says a server delivering a nonce “MUST generate a unique value each time it transmits a policy”, which “SHOULD be at least 128 bits long” and generated by a cryptographically secure random number generator, because, as it explains, a nonce overrides the other restrictions in the directive that delivers it.51 A nonce reused across responses weakens that protection once an attacker can learn it.
'strict-dynamic' is an optional delegation of trust. In supporting browsers it causes host and scheme sources, 'self' and 'unsafe-inline' to be ignored for scripts, and lets a script already trusted by nonce or hash load further scripts through APIs such as document.createElement('script'). web.dev presents it as reducing the effort of deployment where trusted scripts load others dynamically.52 CSP3’s non-normative section 8.5 on strict CSP lists it as part of an effective and deployable set of directives but adds that “it should be avoided when possible”, and section 8.2 is explicit about what it trusts: “If the location of such a script can be controlled by an attacker, the policy will then allow the loading of arbitrary scripts.”51 Where every script a page needs can be listed by nonce or hash, a policy without 'strict-dynamic' grants less. The specification also describes nonce hijacking through dangling markup, where an injection placed just before a legitimate nonced script tag can absorb that tag’s start and reuse its nonce.51
Script gadgets
Lekies and colleagues showed in 2017 how far delegated trust extends. They define script gadgets as “legitimate JavaScript fragments within an application’s legitimate code base” that read the DOM and act on what they find. The attacker injects markup that a sanitiser, filter or policy lets through or leaves in the DOM, and the application’s own trusted library turns it into code.3 The paper treats bypasses of different mitigations separately: a gadget that defeats a sanitiser is not necessarily one that defeats CSP, and the reverse.
For CSP, the relevant boundary is the trust 'strict-dynamic' passes on. A trusted script loader that creates script elements from values in page markup will create them from injected markup too, and 'strict-dynamic' extends trust to what it creates; the paper’s example uses RequireJS.3 Across 16 popular libraries the authors found 'strict-dynamic' bypasses in 13, two of which relied on 'unsafe-eval' also being present. They also found expression-parser gadgets in Aurelia, Vue.js and Polymer 1.x that defeated even nonce-only policies, since such vectors “do not use eval and do not create new script elements”, and a gadget in Ractive that could exfiltrate the page’s nonce into a newly created script. Crawling the Alexa top 5,000 sites, they verified gadgets on 19.88% of second-level domains, which they described as a lower bound.3
The defensive implication is that a strict policy’s protection depends on the libraries a page loads: those that build scripts or evaluate expressions from DOM data extend the trust the policy grants.
Adoption
The HTTP Archive’s 2025 Web Almanac found CSP on 21.9% of sites in its crawl, up from 18.5% the year before.53 The chapter also reports how often keywords such as 'unsafe-inline', nonces and 'strict-dynamic' appear, but its figure descriptions mix units of headers, policies and sites, so those percentages are not used here; the chapter itself notes that keyword presence does not show how a browser enforces a whole policy.53 Strict CSP adoption is not measured by any source used here. Frameworks are starting to help: Django added built-in CSP support in version 6.0, and its documentation warns against excluding paths from the policy because “due to the browser’s same-origin policy”, a vulnerability on an unprotected page “may be leveraged to attack protected pages”.26
Trusted Types
Trusted Types addresses DOM injection sinks. The W3C specification, a Working Draft dated 7 October 2026 and edited by Krzysztof Kotowicz of Google, starts from the observation that there are “over 60 different injection sinks (e.g. Element.innerHTML, or Location.href setters)” and that code like foo[bar] = aString may or may not reach one depending on runtime values, which makes review and static analysis harder.15 When a site configures enforcement with the CSP directive require-trusted-types-for 'script', ordinary string-accepting sinks covered by the specification require the expected trusted type (TrustedHTML, TrustedScript or TrustedScriptURL), created by policies the application registers. A plain string passed to such a sink is converted by the site’s default policy, if one exists, or rejected. The draft also defines separate integrations for HTML parsing with parser options, with their own rules.1525 The Location.href example concerns navigation to javascript: URLs, not every URL assignment. The goal, in the specification’s words, is “reducing the attack surface to small, isolated parts of the web application codebase, which are substantially easier to safeguard, monitor and review”.15
By analogy, it resembles the typed values Google used on its servers, which Data that becomes code describes from Christoph Kern’s account. Kotowicz’s report of July 2021 gave Google’s results for the browser side. Google had migrated 130 services to Trusted Types, building on earlier strict CSP rollouts and its existing Safe HTML Types libraries, using CSP’s report-only mode and gradual rollouts, and without the default policy.16 For that cohort of migrated services the report says: “To date, we have observed zero DOM XSS in Google applications migrated to Trusted Types.” A retrospective analysis of vulnerabilities reported to Google’s reward programme estimated that Trusted Types “could effectively prevent at least 61% of DOM XSS-es missed by our static analysis pipeline”, and the report adds: “Around ¾ of code locations incompatible with Trusted Types can be addressed by mechanical changes.”16 These are Google’s observations about its own services, not a controlled or independent measurement. A Google Research case study by Wang, Guðmundsson and Kotowicz describes the refactoring needed to make Angular compatible.54
Browser support in December 2026
For most of its life Trusted Types was available only in Chromium-based browsers. That has changed:
| Engine | First version with Trusted Types | Source |
|---|---|---|
| Chromium (Chrome, Edge) | 83, May 2020 | Chrome for Developers55 |
| WebKit (Safari) | 26.0, September 2025 | WebKit blog56 |
| Gecko (Firefox) | 148, 24 February 2026 | Firefox release notes48 |
MDN’s browser compatibility data lists the same three versions for the TrustedTypePolicyFactory API and for the require-trusted-types-for and trusted-types CSP directives, and Mozilla’s tracking bug “Ship Trusted Types” is resolved as fixed for Firefox 148.575859 All three engines now support enforcement when a site opts in; users of older browsers run without it.
What it does not do
The specification lists its non-goals plainly. Trusted Types does not “prevent, or mitigate the result of injections into server-side generated markup”, for which it recommends “templating systems or CSP script-src“; it does not address data exfiltration; and it does not protect against “malicious authors of the web application’s JavaScript code”.15 Protection depends on the policies. Section 5.4 of the draft warns that “insecure policies can still expose injection sinks to untrusted data”; a policy whose createHTML returns its input unchanged gives no protection to the HTML sinks fed through it.15 OWASP notes that Trusted Types “does not sanitize input by itself” and that “overly permissive policies can undermine the protection”, and suggests restricting which policy names may be created with the trusted-types directive.25 Section 2.3.5 of the draft, on the default policy that the browser calls when a plain string reaches an injection sink, warns that “a lax, no-op default policy defeats all the benefits of using Trusted Types to protect access to injection sinks” and advises using a default policy in a transitional period only.15
Frameworks pass typed values through. React’s reference says that if a site enforces Trusted Types, a TrustedHTML value passed to dangerouslySetInnerHTML is handed to the browser “without converting it to a string”.30 Angular’s security guide recommends enabling Trusted Types enforcement alongside CSP, noting that “unless you enforce Trusted Types, the built-in browser DOM APIs don’t automatically protect you”.31
Why it persists
The sources support four observations about why XSS keeps being found, none of which is ignorance of the bug. They are about engineering, and do not by themselves explain the statistical rank, which reflects how many CVE records map to the weakness and their severity.5
- Coverage, not knowledge. OWASP’s cheat sheet puts it simply: “an application that protects 99 places and misses one is still vulnerable.”25 Auto-escaping raised the floor, and what remains includes hatches, unusual contexts and helper functions, as in the Laravel and Django fixes of November and December 2026.
- The HTML platform keeps changing. A sanitised result can stop being safe through later handling or browser behaviour the sanitiser did not anticipate; DOMPurify’s
selectedcontentadvisory was triggered by a newly added element.42 - Client-side XSS is a large share where it has been measured. In Google’s reward programme, DOM XSS was more than half of reported XSS by 2021, and server-side template escaping does not reach it.16 No source used here measures that share industry-wide.
- Coverage and deployment of mitigations remain limited. In the 2016 study most allowlist policies could be bypassed; CSP of any kind was present on 21.9% of sites in the 2025 crawl; and Trusted Types reached all three engines only in February 2026 and protects only sites that enforce it.495348
A further explanation is a hypothesis, unmeasured here: XSS has a cheap, unambiguous proof, a script running on the vendor’s own domain, which may make it easier to find and report in volume than classes that need deeper analysis. HackerOne’s figure that 78% of valid hackbot findings were XSS is consistent with that, but it covers only automated findings on one platform and cannot show whether proof cost drives counts across vendors or the Top 25 rank.13
What to do differently
The controls fit different application designs:
| Situation | Main controls | Evidence |
|---|---|---|
| Mostly static or cached pages | Contextual templates; hash-based strict CSP | web.dev recommends hashes for statically served or cached pages52 |
| Server-rendered application with rich user HTML | Contextual templates with few, reviewed hatches; sanitising at insertion; nonce-based strict CSP; active user content rendered in an isolated site | OWASP cheat sheet; web.dev; Google’s user-content design255260 |
| Legacy client-side application with third-party sink writes | Trusted Types in report-only mode to find sink uses, refactoring, then enforcement; a default policy only if needed as a strict, temporary bridge | Trusted Types use case and default-policy note; Google’s rollout without one1516 |
Operational details that change decisions:
- Treat every escape hatch as reviewed code.
{!! !!},|safe,mark_safe,dangerouslySetInnerHTML,bypassSecurityTrust*and similar APIs should fail a lint or code-owner check unless they are in an approved wrapper that sanitises or that takes a typed value. Build HTML fragments withformat_html()or equivalents instead of concatenating marked-safe strings, since Django warns that a safe string modified afterwards “will become unsafe again”.29 - Keep values in contexts the encoder was designed for. Quote attributes, use HTML encoding only for text and inert attribute values, and do not interpolate into
<script>,<style>, event-handler attributes or comments.25 To pass data to scripts, use a serialiser built for embedding in HTML, such as Django’sjson_script, which writes JSON into atype="application/json"script element and escapes<,>and&; a JSON type andJSON.parsealone do not protect the surrounding HTML.28 Validate URL schemes against an allowlist even where the framework blocksjavascript:.25 - Prefer safe DOM APIs on the client, within their limits. OWASP’s DOM-based XSS cheat sheet recommends
document.createElement,setAttributeandappendChildover string-built HTML, and adds thatsetAttribute“is only safe for a limited number of attributes”, listing inert ones such asclass,altanddir.61textContentis a safe text sink for inert destinations; the text of a script element is itself listed among the injection sinks.15 - Sanitise last, at the point of insertion. Insert the result directly into the context the sanitiser was built for, and do not wrap, concatenate or template it afterwards; if the HTML must change later, sanitise again.25 Use
setHTML()where it is available, keeping<base>out of custom allowlists, and a maintained library such as DOMPurify where it is not. Treat sanitiser updates like security patches.4625 - Observe a strict CSP before enforcing it. Send it first as
Content-Security-Policy-Report-Only, which must be a header; violations then appear in the browser console, and collecting them from users needs a reporting directive with a destination, which Django’s CSP settings support.526251 For nonce-based policies, the header and markup need a fresh, matching nonce for every policy transmission, which Django notes “involves secure randomness for each applicable request”; serving a cached page that repeats a nonce weakens the protection if the nonce can be learned.2651 For hash-based policies, each inline script has its own hash, so the policy changes whenever an inline script does.52 Audit libraries that build script elements or evaluate expressions from DOM data, and use'strict-dynamic'only where explicit nonces or hashes for every script are impractical.351 - Stage Trusted Types. Report-only mode shows which sinks receive strings without blocking them. A temporary default policy changes that signal, because strings it converts no longer appear as failures, so introduce one, if at all, after the report-only inventory.15 Keep policies few and named, and restrict them with the
trusted-typesdirective.25 - Use cookie attributes to limit damage.
HttpOnlykeeps script from reading the cookies it marks;Securesends a cookie only onhttps:requests, except on localhost;SameSiterestricts cookies on cross-site requests. None stops same-site requests the payload makes from the page, and none protects credentials kept elsewhere, such as tokens in the DOM.20 - Render user content away from the main site. Google’s 2023 post describes the classic sandbox domain, a separate site for untrusted content, and notes that it isolates user content from the main site but not from other user content. For active content such as HTML or SVG, Google’s design adds a sandbox domain to the Public Suffix List, renders each piece of content on a random subdomain of it through a shim, and displays it inside a sandboxed iframe, so that each rendering is on a unique site. The post also describes the simpler
Content-Security-Policy: sandboxheader, noting that not all browsers isolate sandboxed documents in separate processes. For inactive content such as downloads it gives a combined header recipe: a well-knownContent-Typethat cannot hold active content,X-Content-Type-Options: nosniff,Content-Disposition: attachment,Content-Security-Policy: sandbox,Content-Security-Policy: default-src 'none'andCross-Origin-Resource-Policy: same-site.60 - Do not rely on WAFs. OWASP’s cheat sheet warns that WAFs “cannot reliably prevent all XSS attacks” and “may miss DOM-based XSS that occurs entirely in the browser”; the mXSS paper reported WAF bypasses with input that was harmless until the browser mutated it.2539 A rule for a known vulnerable parameter can be a stopgap while a fix is deployed, with the limits set out in the virtual patching article.
- Patch frameworks, and recompile where the fix requires it. Django’s fix needs the upgrade to 6.1.4, 6.0.11 or 5.2.20.32 Laravel’s Blade fix needs the upgrade and then recompilation of previously compiled views with
php artisan view:clearorview:cache.34
Conclusion
Cross-site scripting persists because a web page combines several languages and every defence covers only some of them. Auto-escaping handles the contexts its authors expected and leaves raw-output hatches, unusual contexts and its own edge cases, as two framework fixes of November and December 2026 illustrate. Sanitisers are safe only for the insertion they were designed for, and the mutation XSS research and recent sanitiser advisories illustrate how later handling or parsing can break that. Host allowlists were mostly bypassable in the 2016 measurement, and a nonce-based policy can be weakened by trusted libraries that turn DOM data into script.
The sources measure different things, from crawl statistics and controlled bypass testing to one company’s rollout, and none compares the controls head to head. Where unsafe sinks can be removed, typed sinks and contextual templates take the decision away from individual call sites. Where legacy pages and third-party scripts write to sinks, staged enforcement, beginning in report-only mode, lets teams find them before blocking. 'strict-dynamic' eases deployment at the cost of trusting whatever trusted scripts load. Google reported in July 2021 that its migrated services had seen no DOM XSS, an observation about its own services. None of these controls removes the need to isolate user content, patch frameworks promptly and expect an escape hatch to be missed somewhere.
Footnotes
- CWE-79: Improper Neutralization of Input During Web Page Generation (‘Cross-site Scripting’), MITRE, accessed 4 December 2026. https://cwe.mitre.org/data/definitions/79.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- CERT Coordination Center, CA-2000-02, “Malicious HTML Tags Embedded in Client Web Requests”, original release 2 February 2000, in the CERT/CC 2000 advisories compilation, Software Engineering Institute. https://insights.sei.cmu.edu/documents/507/2000_019_001_496188.pdf (opens in a new tab) ↩
- Sebastian Lekies, Krzysztof Kotowicz, Samuel Groß, Eduardo A. Vela Nava and Martin Johns, “Code-Reuse Attacks for the Web: Breaking Cross-Site Scripting Mitigations via Script Gadgets”, ACM CCS 2017 (copy hosted by TU Braunschweig). https://poseidon.ias.tu-bs.de/papers/2017_CCS_Code_Reuse.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- 2025 CWE Top 25 Most Dangerous Software Weaknesses, MITRE, accessed 4 December 2026. https://cwe.mitre.org/top25/archive/2025/2025_cwe_top25.html (opens in a new tab) ↩
- 2025 CWE Top 25 Methodology, MITRE, accessed 4 December 2026. https://cwe.mitre.org/top25/archive/2025/2025_methodology.html (opens in a new tab) ↩1 ↩2 ↩3
- A03:2021 Injection, OWASP Top 10:2021. https://owasp.org/Top10/2021/A03_2021-Injection/ (opens in a new tab) ↩
- A05:2025 Injection, OWASP Top 10:2025, accessed 4 December 2026. https://owasp.org/Top10/2025/A05_2025-Injection/ (opens in a new tab) ↩1 ↩2
- National Vulnerability Database CVE API 2.0, query for all CVE records published 1 January to 30 April 2025 (first of four date windows covering 2025), run 4 December 2026. https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=1&pubStartDate=2025-01-01T00:00:00.000Z&pubEndDate=2025-04-30T23:59:59.999Z (opens in a new tab) ↩
- National Vulnerability Database CVE API 2.0, query for CWE-79 records published 1 January to 30 April 2025 (first of four date windows covering 2025), run 4 December 2026. https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=1&cweId=CWE-79&pubStartDate=2025-01-01T00:00:00.000Z&pubEndDate=2025-04-30T23:59:59.999Z (opens in a new tab) ↩
- National Vulnerability Database CVE API 2.0, exact-phrase keyword query for “cross-site scripting”, records published 1 January to 30 April 2025 (first of four windows covering 2025), run 4 December 2026. https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=1&keywordSearch=cross-site%20scripting&keywordExactMatch&pubStartDate=2025-01-01T00:00:00.000Z&pubEndDate=2025-04-30T23:59:59.999Z (opens in a new tab) ↩
- Sucuri Malware Research Team, “Vulnerability & Patch Roundup — November 2026”, Sucuri blog, 30 November 2026 (entry counts are the author’s tally). https://blog.sucuri.net/2026/11/vulnerability-patch-roundup-november-2026.html (opens in a new tab) ↩
- “3 Signals You Can’t Ignore from the 2025 Hacker-Powered Security Report”, HackerOne blog (remarks attributed to Luke Stephens), 4 November 2025. https://www.hackerone.com/blog/ai-security-trends-2025 (opens in a new tab) ↩
- “How AI Security Is Transforming Offensive Security: Insights to Carry Into 2026”, HackerOne blog, 6 January 2026. https://www.hackerone.com/blog/2025-hpsr-researcher-signals (opens in a new tab) ↩1 ↩2 ↩3
- Types of Cross-Site Scripting, OWASP Foundation, accessed 4 December 2026. https://owasp.org/www-community/Types_of_Cross-Site_Scripting (opens in a new tab) ↩1 ↩2 ↩3
- Trusted Types, W3C Working Draft, 7 October 2026, ed. Krzysztof Kotowicz. https://www.w3.org/TR/trusted-types/ (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11
- Krzysztof Kotowicz, “Trusted Types - mid 2021 report”, Google, 6 July 2021. https://storage.googleapis.com/gweb-research2023-media/pubtools/6259.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Same-origin policy, MDN Web Docs, accessed 4 December 2026. https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Same-origin_policy (opens in a new tab) ↩
- Cross Site Scripting (XSS), OWASP Foundation, accessed 4 December 2026. https://owasp.org/www-community/attacks/xss/ (opens in a new tab) ↩
- Samy Kamkar, “Technical explanation of The MySpace Worm”, samy.pl, accessed 4 December 2026. https://samy.pl/myspace/tech.html (opens in a new tab) ↩1 ↩2
- Set-Cookie header, MDN Web Docs, accessed 4 December 2026. https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie (opens in a new tab) ↩1 ↩2 ↩3
- Cross-Site Request Forgery Prevention Cheat Sheet, OWASP Cheat Sheet Series, accessed 4 December 2026. https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html (opens in a new tab) ↩
- Samy Kamkar, “The MySpace Worm” (personal account), samy.pl, accessed 4 December 2026. https://samy.pl/myspace/ (opens in a new tab) ↩
- The Django template language: automatic HTML escaping, Django 6.0 documentation. https://docs.djangoproject.com/en/6.0/ref/templates/language/ (opens in a new tab) ↩
- Blade Templates, Laravel 12.x documentation. https://laravel.com/docs/12.x/blade (opens in a new tab) ↩1 ↩2
- Cross Site Scripting Prevention Cheat Sheet, OWASP Cheat Sheet Series, accessed 4 December 2026. https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16 ↩17
- Security in Django, Django 6.0 documentation. https://docs.djangoproject.com/en/6.0/topics/security/ (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- “React v16.9.0 and the Roadmap Update”, React blog, 8 August 2019. https://legacy.reactjs.org/blog/2019/08/08/react-v16.9.0.html (opens in a new tab) ↩
- Built-in template tags and filters: json_script, Django 6.0 documentation. https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#json-script (opens in a new tab) ↩1 ↩2
- Django Utils: django.utils.safestring and django.utils.html, Django 6.0 documentation. https://docs.djangoproject.com/en/6.0/ref/utils/ (opens in a new tab) ↩1 ↩2
- Common components (e.g. div), React reference, accessed 4 December 2026. https://react.dev/reference/react-dom/components/common (opens in a new tab) ↩1 ↩2
- Security, Angular documentation, accessed 4 December 2026. https://angular.dev/best-practices/security (opens in a new tab) ↩1 ↩2
- Jacob Walls, “Django security releases issued: 6.1.4, 6.0.11, and 5.2.20”, Django weblog, 2 December 2026. https://www.djangoproject.com/weblog/2026/dec/02/security-releases/ (opens in a new tab) ↩1 ↩2 ↩3
- Fix for CVE-2026-115868 (commit 454f44fc on the main branch), django/django, GitHub, December 2026. https://github.com/django/django/commit/454f44fc8f52d0b925a7661b9809061f257eeac9 (opens in a new tab) ↩
- GHSA-9966-43cq-4mpr (CVE-2026-142638), “Unescaped bound attributes on Blade dynamic components that resolve to class-based components”, laravel/framework, GitHub, published 18 November 2026. https://github.com/laravel/framework/security/advisories/GHSA-9966-43cq-4mpr (opens in a new tab) ↩1 ↩2 ↩3
- Release v13.43.0, laravel/framework, GitHub, 17 November 2026. https://github.com/laravel/framework/releases/tag/v13.43.0 (opens in a new tab) ↩
- Release v12.73.0, laravel/framework, GitHub, 17 November 2026. https://github.com/laravel/framework/releases/tag/v12.73.0 (opens in a new tab) ↩
- laravel/framework security advisories, GitHub REST API listing (five entries dated 2 December 2026), read 4 December 2026. https://api.github.com/repos/laravel/framework/security-advisories?per_page=100 (opens in a new tab) ↩
- GHSA-58jq-583v-r2jw, “HTML attribute injection in Markdown mail when Markdown::withSecuredEncoding() is enabled”, laravel/framework, GitHub, published 2 December 2026. https://github.com/laravel/framework/security/advisories/GHSA-58jq-583v-r2jw (opens in a new tab) ↩1 ↩2
- Mario Heiderich, Jörg Schwenk, Tilman Frosch, Jonas Magazinius and Edward Z. Yang, “mXSS Attacks: Attacking well-secured Web-Applications by using innerHTML Mutations”, ACM CCS 2013 (copy hosted by Cure53). https://cure53.de/fp170.pdf (opens in a new tab) ↩1 ↩2 ↩3
- cure53/DOMPurify security advisories, GitHub REST API listing, read 4 December 2026. https://api.github.com/repos/cure53/DOMPurify/security-advisories?per_page=100 (opens in a new tab) ↩
- GHSA-h8r8-wccr-v5f2, “DOMPurify mXSS via Re-Contextualization”, cure53/DOMPurify, GitHub, 25 March 2026. https://github.com/cure53/DOMPurify/security/advisories/GHSA-h8r8-wccr-v5f2 (opens in a new tab) ↩
- GHSA-87xg-pxx2-7hvx (CVE-2026-47423), “DOMPurify XSS via selectedcontent re-clone”, cure53/DOMPurify, GitHub, 19 May 2026. https://github.com/cure53/DOMPurify/security/advisories/GHSA-87xg-pxx2-7hvx (opens in a new tab) ↩1 ↩2
- GHSA-hrxw-jjj6-2g2j (CVE-2026-144292), “SAFE_FOR_TEMPLATES bypass: nested form makes a template expression reassemble when sanitized output is reparsed”, cure53/DOMPurify, GitHub, 23 November 2026. https://github.com/cure53/DOMPurify/security/advisories/GHSA-hrxw-jjj6-2g2j (opens in a new tab) ↩
- GHSA-gx9m-whjm-85jf (CVE-2024-47875), “nesting-based mXSS”, cure53/DOMPurify, GitHub, 11 October 2024. https://github.com/cure53/DOMPurify/security/advisories/GHSA-gx9m-whjm-85jf (opens in a new tab) ↩
- HTML Living Standard, section 8.5 “DOM parsing and serialization APIs” (setHTML), WHATWG, accessed 4 December 2026. https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-element-sethtml (opens in a new tab) ↩
- MDN browser-compat-data, api/Element.json (Element.setHTML), main branch, read 4 December 2026. https://github.com/mdn/browser-compat-data/blob/main/api/Element.json (opens in a new tab) ↩1 ↩2 ↩3
- MDN browser-compat-data, api/Sanitizer.json, main branch, read 4 December 2026. https://github.com/mdn/browser-compat-data/blob/main/api/Sanitizer.json (opens in a new tab) ↩
- Firefox 148.0 release notes, Mozilla, 24 February 2026. https://www.firefox.com/en-US/firefox/148.0/releasenotes/ (opens in a new tab) ↩1 ↩2 ↩3
- Lukas Weichselbaum, Michele Spagnuolo, Sebastian Lekies and Artur Janc, “CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy”, ACM CCS 2016, Google Research publication page. https://research.google/pubs/csp-is-dead-long-live-csp-on-the-insecurity-of-whitelists-and-the-future-of-content-security-policy/ (opens in a new tab) ↩1 ↩2 ↩3
- Weichselbaum et al., “CSP Is Dead, Long Live CSP!”, full text, sections 2.3.1 and 2.3.2, Google Research. https://storage.googleapis.com/gweb-research2023-media/pubtools/pdf/45542.pdf (opens in a new tab) ↩
- Content Security Policy Level 3, W3C Working Draft, 27 October 2026, sections 7.1, 7.2 and 8.2. https://www.w3.org/TR/CSP3/ (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
- Lukas Weichselbaum, “Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP)”, web.dev, last updated 13 September 2024. https://web.dev/articles/strict-csp (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Security chapter, Web Almanac 2025, HTTP Archive. https://almanac.httparchive.org/en/2025/security (opens in a new tab) ↩1 ↩2 ↩3
- Pei Wang, Bjarki Ágúst Guðmundsson and Krzysztof Kotowicz, “Adopting Trusted Types in Production Web Frameworks to Prevent DOM-Based Cross-Site Scripting: A Case Study”, IEEE European Symposium on Security and Privacy Workshops 2021, Google Research publication page. https://research.google/pubs/adopting-trusted-types-in-production-web-frameworks-to-prevent-dom-based-cross-site-scripting-a-case-study/ (opens in a new tab) ↩
- Pete LePage, “New in Chrome 83”, Chrome for Developers, 19 May 2020. https://developer.chrome.com/blog/new-in-chrome-83 (opens in a new tab) ↩
- “WebKit Features in Safari 26.0”, WebKit blog, 15 September 2025. https://webkit.org/blog/17333/webkit-features-in-safari-26-0/ (opens in a new tab) ↩
- MDN browser-compat-data, api/TrustedTypePolicyFactory.json, main branch, read 4 December 2026. https://github.com/mdn/browser-compat-data/blob/main/api/TrustedTypePolicyFactory.json (opens in a new tab) ↩
- MDN browser-compat-data, http/headers/Content-Security-Policy.json (require-trusted-types-for, trusted-types), main branch, read 4 December 2026. https://github.com/mdn/browser-compat-data/blob/main/http/headers/Content-Security-Policy.json (opens in a new tab) ↩
- Bug 1994690, “Ship Trusted Types”, Mozilla Bugzilla, resolved fixed for Firefox 148. https://bugzilla.mozilla.org/show_bug.cgi?id=1994690 (opens in a new tab) ↩
- David Dworken, “Securely hosting user data in modern web applications”, Google Online Security Blog, 18 April 2023. https://security.googleblog.com/2023/04/securely-hosting-user-data-in-modern.html (opens in a new tab) ↩1 ↩2
- DOM based XSS Prevention Cheat Sheet, OWASP Cheat Sheet Series, accessed 4 December 2026. https://cheatsheetseries.owasp.org/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.html (opens in a new tab) ↩
- Content Security Policy reference, Django 6.0 documentation. https://docs.djangoproject.com/en/6.0/ref/csp/ (opens in a new tab) ↩

SecSIG