<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://web.dev/</id>
  <title>Krzysztof Kotowicz on web.dev</title>
  <updated>2026-04-15T23:21:06Z</updated>
  <author>
    <name>Krzysztof Kotowicz</name>
  </author>
  <link href="https://web.dev/authors/koto/feed.xml" rel="self"/>
  <link href="https://web.dev/"/>
  <icon>https://web-dev.imgix.net/image/admin/1v5F1SOBl46ZghbHQMle.svg</icon>
  <logo>https://web.dev/images/shared/rss-banner.png</logo>
  <subtitle>Our latest news, updates, and stories by Krzysztof Kotowicz.</subtitle>
  
  
  <entry>
    <title>Prevent DOM-based cross-site scripting vulnerabilities with Trusted Types</title>
    <link href="https://web.dev/trusted-types/"/>
    <updated>2020-03-25T00:00:00Z</updated>
    <id>https://web.dev/trusted-types/</id>
    <content type="html" mode="escaped">&lt;h2 id=&quot;why-should-you-care&quot;&gt;Why should you care? &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#why-should-you-care&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;DOM-based cross-site scripting (DOM XSS) is one of the most common web
security vulnerabilities, and it&#39;s very easy to introduce it in
your application. &lt;a href=&quot;https://github.com/w3c/webappsec-trusted-types&quot; rel=&quot;noopener&quot;&gt;Trusted Types&lt;/a&gt;
give you the tools to write, security
review, and maintain applications free of DOM XSS vulnerabilities by making the dangerous web API
functions secure by default. Trusted Types are supported in Chrome 83, and
a &lt;a href=&quot;https://github.com/w3c/webappsec-trusted-types#polyfill&quot; rel=&quot;noopener&quot;&gt;polyfill&lt;/a&gt; is available
for other browsers. See &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types#browser_compatibility&quot; rel=&quot;noopener&quot;&gt;Browser compatibility&lt;/a&gt; for up-to-date
cross-browser support information.&lt;/p&gt;
&lt;aside class=&quot;aside flow color-secondary-box-text bg-secondary-box-bg&quot;&gt;&lt;p class=&quot;cluster &quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;currentColor&quot; role=&quot;img&quot; aria-label=&quot;Highlighter pen&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;   &lt;path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M10.22 9.49l-5.91 6c-.77.8-.7 2.05.08 2.85L.77 22h5.68l.74-.75c.78.81 1.95.86 2.73.05l5.96-6.05-5.66-5.76zm12.46-4l-2.82-2.87c-.78-.8-2.07-.84-2.84-.04l-5.75 5.85 5.66 5.75 5.69-5.78c.77-.81.83-2.11.06-2.91z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Key Term&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt; DOM-based cross-site scripting happens when data from a user controlled &lt;em&gt;source&lt;/em&gt; (like user name, or redirect URL taken from the URL fragment) reaches a &lt;em&gt;sink&lt;/em&gt;, which is a function like &lt;code&gt;eval()&lt;/code&gt; or a property setter like &lt;code&gt;.innerHTML&lt;/code&gt;, that can execute arbitrary JavaScript code. &lt;/div&gt;&lt;/aside&gt;
&lt;h2 id=&quot;background&quot;&gt;Background &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#background&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For many years &lt;a href=&quot;https://owasp.org/www-community/attacks/xss/&quot; rel=&quot;noopener&quot;&gt;DOM XSS&lt;/a&gt;
has been one of the most prevalent—and dangerous—web security vulnerabilities.&lt;/p&gt;
&lt;p&gt;There are two distinct groups of cross-site scripting. Some
XSS vulnerabilities are caused by the server-side code that insecurely creates the HTML code
forming the website. Others have a root cause on the client, where the JavaScript
code calls dangerous functions with user-controlled content.&lt;/p&gt;
&lt;p&gt;To &lt;a href=&quot;https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html&quot; rel=&quot;noopener&quot;&gt;prevent server-side XSS&lt;/a&gt;, don&#39;t generate
HTML by concatenating strings and use safe contextual-autoescaping templating
libraries instead. Use a &lt;a href=&quot;https://csp.withgoogle.com/docs/strict-csp.html&quot; rel=&quot;noopener&quot;&gt;nonce-based Content Security Policy&lt;/a&gt; for additional mitigation against the bugs as they inevitably happen.&lt;/p&gt;
&lt;p&gt;Now a browser can also help prevent the client-side (also known as DOM-based)
XSSes with &lt;a href=&quot;https://bit.ly/trusted-types&quot; rel=&quot;noopener&quot;&gt;Trusted Types&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;api-introduction&quot;&gt;API introduction &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#api-introduction&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Trusted Types work by locking down the following risky sink functions.
You might already recognize some of them, as browsers vendors and &lt;a href=&quot;https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml&quot; rel=&quot;noopener&quot;&gt;web frameworks&lt;/a&gt; already steer you away from using
these features for security reasons.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Script manipulation&lt;/strong&gt;:&lt;br /&gt;
&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML/Element/script#attr-src&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;&amp;lt;script src&amp;gt;&lt;/code&gt;&lt;/a&gt; and setting text content of &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML/Element/script&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;&lt;/a&gt; elements.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Generating HTML from a string&lt;/strong&gt;:&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/Element/innerHTML&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;innerHTML&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/Element/outerHTML&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;outerHTML&lt;/code&gt;&lt;/a&gt;,&lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;insertAdjacentHTML&lt;/code&gt;&lt;/a&gt;,
&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML/Element/iframe#attr-srcdoc&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;&amp;lt;iframe&amp;gt; srcdoc&lt;/code&gt;&lt;/a&gt;,
&lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/Document/write&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;document.write&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/Document/writeln&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;document.writeln&lt;/code&gt;&lt;/a&gt;,
and &lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/DOMParser#DOMParser.parseFromString&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;DOMParser.parseFromString&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Executing plugin content&lt;/strong&gt;:&lt;br /&gt;
&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML/Element/embed#attr-src&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;&amp;lt;embed src&amp;gt;&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML/Element/object#attr-data&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;&amp;lt;object data&amp;gt;&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML/Element/object#attr-codebase&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;&amp;lt;object codebase&amp;gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Runtime JavaScript code compilation&lt;/strong&gt;: &lt;br /&gt;
&lt;code&gt;eval&lt;/code&gt;, &lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;setInterval&lt;/code&gt;, &lt;code&gt;new Function()&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Trusted Types require you to process the data before passing it to the above
sink functions. Just using a string will fail, as the browser doesn&#39;t know
if the data is trustworthy:&lt;/p&gt;
&lt;figure class=&quot;compare flow&quot; data-type=&quot;worse&quot; data-size=&quot;full&quot;&gt;&lt;p class=&quot;compare__label&quot;&gt;Don&#39;t&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;anElement&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML  &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; location&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;href&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;figcaption class=&quot;compare__caption&quot;&gt;
&lt;p&gt;With Trusted Types enabled, the browser throws a &lt;em&gt;TypeError&lt;/em&gt; and prevents use of
a DOM XSS sink with a string.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;To signify that the data was securely processed, create a special object - a Trusted Type.&lt;/p&gt;
&lt;figure class=&quot;compare flow&quot; data-type=&quot;better&quot; data-size=&quot;full&quot;&gt;&lt;p class=&quot;compare__label&quot;&gt;Do&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;anElement&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; aTrustedHTML&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;figcaption class=&quot;compare__caption&quot;&gt;
&lt;p&gt;With Trusted Types enabled, the browser accepts a &lt;code&gt;TrustedHTML&lt;/code&gt; object for sinks
that expect HTML snippets. There are also &lt;code&gt;TrustedScript&lt;/code&gt; and &lt;code&gt;TrustedScriptURL&lt;/code&gt;
objects for other sensitive sinks.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Trusted Types heavily reduce the DOM XSS &lt;a href=&quot;https://en.wikipedia.org/wiki/Attack_surface&quot; rel=&quot;noopener&quot;&gt;attack surface&lt;/a&gt;
of your application. It simplifies security reviews, and allows you to enforce the type-based
security checks done when compiling, linting, or bundling your code at runtime,
in the browser.&lt;/p&gt;
&lt;h2 id=&quot;how-to-use-trusted-types&quot;&gt;How to use Trusted Types &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#how-to-use-trusted-types&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;prepare-for-content-security-policy-violation-reports&quot;&gt;Prepare for Content Security Policy violation reports &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#prepare-for-content-security-policy-violation-reports&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can deploy a report collector
(such as the open-source &lt;a href=&quot;https://github.com/jacobbednarz/go-csp-collector&quot; rel=&quot;noopener&quot;&gt;go-csp-collector&lt;/a&gt;),
or use one of the commercial equivalents.
You can also debug the violations in the browser:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-js&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;document&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;securitypolicyviolation&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;br /&gt;    console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;console&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h3 id=&quot;add-a-report-only-csp-header&quot;&gt;Add a report-only CSP header &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#add-a-report-only-csp-header&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Add the following HTTP Response header to documents that you want to migrate to
Trusted Types.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Content-Security-Policy-Report-Only: require-trusted-types-for &#39;script&#39;; report-uri //my-csp-endpoint.example&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Now all the violations are reported to &lt;code&gt;//my-csp-endpoint.example&lt;/code&gt;,
but the website continues to work. The next section explains how &lt;code&gt;//my-csp-endpoint.example&lt;/code&gt; works.&lt;/p&gt;
&lt;aside class=&quot;aside flow bg-state-bad-bg color-state-bad-text&quot;&gt;&lt;p class=&quot;cluster color-state-bad-text&quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;Error sign&quot;&gt;   &lt;path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-2h2v2h-2zm0-10v6h2V7h-2z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Caution&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt; Trusted Types are only available in a &lt;a href=&quot;https://developer.mozilla.org/docs/Web/Security/Secure_Contexts&quot;&gt;secure context&lt;/a&gt; like HTTPS and &lt;code&gt;localhost&lt;/code&gt;. &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;identify-trusted-types-violations&quot;&gt;Identify Trusted Types violations &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#identify-trusted-types-violations&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;From now on, every time Trusted Types detect a violation, a report will be sent
to a configured &lt;code&gt;report-uri&lt;/code&gt;. For example, when your application
passes a string to &lt;code&gt;innerHTML&lt;/code&gt;, the browser sends the following report:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-json&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token property&quot;&gt;&quot;csp-report&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;document-uri&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;https://my.url.example&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;violated-directive&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;require-trusted-types-for&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;disposition&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;report&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;blocked-uri&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;trusted-types-sink&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;line-number&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;39&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;column-number&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;source-file&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;https://my.url.example/script.js&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;status-code&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token property&quot;&gt;&quot;script-sample&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Element innerHTML &amp;lt;img src=x&quot;&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;This says that in &lt;code&gt;https://my.url.example/script.js&lt;/code&gt; on line 39 &lt;code&gt;innerHTML&lt;/code&gt; was called with
the string beginning with &lt;code&gt;&amp;lt;img src=x&lt;/code&gt;.
This information should help you narrow down which parts of code may be
introducing DOM XSS and need to change.&lt;/p&gt;
&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt; Most of the violations like this can also be detected by running a code linter or &lt;a href=&quot;https://github.com/mozilla/eslint-plugin-no-unsanitized&quot;&gt;static code checkers&lt;/a&gt; on your codebase. This helps quickly identify a large chunk of violations.  That said, you should also analyze the CSP violations, as these trigger when the non-conforming code is executed. &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;fix-the-violations&quot;&gt;Fix the violations &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#fix-the-violations&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are a couple of options for fixing a Trusted Type violation. You can &lt;a href=&quot;https://web.dev/trusted-types/#remove-the-offending-code&quot;&gt;remove the offending code&lt;/a&gt;, &lt;a href=&quot;https://web.dev/trusted-types/#use-a-library&quot;&gt;use a library&lt;/a&gt;, &lt;a href=&quot;https://web.dev/trusted-types/#create-a-trusted-type-policy&quot;&gt;create a Trusted Type policy&lt;/a&gt; or, as a last resort, &lt;a href=&quot;https://web.dev/trusted-types/#create-a-default-policy&quot;&gt;create a default policy&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&quot;rewrite-the-offending-code&quot;&gt;Rewrite the offending code &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#rewrite-the-offending-code&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Perhaps the non-conforming functionality is not needed anymore or can be
rewritten in a modern way without using the error-prone functions?&lt;/p&gt;
&lt;figure class=&quot;compare flow&quot; data-type=&quot;worse&quot; data-size=&quot;full&quot;&gt;&lt;p class=&quot;compare__label&quot;&gt;Don&#39;t&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&amp;lt;img src=xyz.jpg&gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;figure class=&quot;compare flow&quot; data-type=&quot;better&quot; data-size=&quot;full&quot;&gt;&lt;p class=&quot;compare__label&quot;&gt;Do&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;textContent &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; img &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; document&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;img&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;img&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;src &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;xyz.jpg&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;appendChild&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;img&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;h4 id=&quot;use-a-library&quot;&gt;Use a library &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#use-a-library&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Some libraries already generate Trusted Types that you can pass to the
sink functions. For example, you can use
&lt;a href=&quot;https://github.com/cure53/DOMPurify&quot; rel=&quot;noopener&quot;&gt;DOMPurify&lt;/a&gt; to
sanitize an HTML snippet, removing XSS payloads.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; DOMPurify &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;dompurify&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; DOMPurify&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;sanitize&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;html&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token constant&quot;&gt;RETURN_TRUSTED_TYPE&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;DOMPurify &lt;a href=&quot;https://github.com/cure53/DOMPurify#what-about-dompurify-and-trusted-types&quot; rel=&quot;noopener&quot;&gt;supports Trusted Types&lt;/a&gt; and will return sanitized
HTML wrapped in a &lt;code&gt;TrustedHTML&lt;/code&gt; object such that the browser does not generate
a violation.&lt;/p&gt;
&lt;aside class=&quot;aside flow bg-state-bad-bg color-state-bad-text&quot;&gt;&lt;p class=&quot;cluster color-state-bad-text&quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;Error sign&quot;&gt;   &lt;path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-2h2v2h-2zm0-10v6h2V7h-2z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Caution&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt; If the sanitization logic in DOMPurify is buggy, your application might still have a DOM XSS vulnerability. Trusted Types force you to process a value &lt;em&gt;somehow&lt;/em&gt;, but don&#39;t yet define what the exact processing rules are, and whether they are safe. &lt;/div&gt;&lt;/aside&gt;
&lt;h4 id=&quot;create-a-trusted-type-policy&quot;&gt;Create a Trusted Type policy &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#create-a-trusted-type-policy&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Sometimes it&#39;s not possible to remove the functionality, and there is no
library to sanitize the value and create a Trusted Type for you.
In those cases, create a Trusted Type object yourself.&lt;/p&gt;
&lt;p&gt;For that, first create a &lt;a href=&quot;https://w3c.github.io/trusted-types/dist/spec/#policies-hdr&quot; rel=&quot;noopener&quot;&gt;policy&lt;/a&gt;. Policies are factories for Trusted Types that enforce certain security rules on their input:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;trustedTypes &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;createPolicy&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Feature testing&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; escapeHTMLPolicy &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createPolicy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;myEscapePolicy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;mark class=&quot;highlight-line highlight-line-active&quot;&gt;    &lt;span class=&quot;token function-variable function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token parameter&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; string&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token regex&quot;&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-source language-regex&quot;&gt;&lt;span class=&quot;token escape&quot;&gt;\&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-flags&quot;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&amp;amp;lt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/mark&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;highlight-line&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;This code creates a policy called &lt;code&gt;myEscapePolicy&lt;/code&gt; that can produce &lt;code&gt;TrustedHTML&lt;/code&gt;
objects via its &lt;code&gt;createHTML()&lt;/code&gt; function. The defined rules will
HTML-escape &lt;code&gt;&amp;lt;&lt;/code&gt; characters to prevent the creation of new HTML elements.&lt;/p&gt;
&lt;p&gt;Use the policy like so:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; escaped &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; escapeHTMLPolicy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;&amp;lt;img src=x onerror=alert(1)&gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;escaped &lt;span class=&quot;token keyword&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;TrustedHTML&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;// true&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; escaped&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;// &#39;&amp;amp;lt;img src=x onerror=alert(1)&gt;&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt; While the JavaScript function passed to &lt;code&gt;trustedTypes.createPolicy()&lt;/code&gt; as &lt;code&gt;createHTML()&lt;/code&gt; returns a string, &lt;code&gt;createPolicy()&lt;/code&gt; returns a policy object that wraps the return value in a correct type - in this case &lt;code&gt;TrustedHTML&lt;/code&gt;. &lt;/div&gt;&lt;/aside&gt;
&lt;h4 id=&quot;use-a-default-policy&quot;&gt;Use a default policy &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#use-a-default-policy&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Sometimes you can&#39;t change the offending code. For example, this is the case if you&#39;re loading a third-party library from a CDN. In that case, use a
&lt;a href=&quot;https://w3c.github.io/trusted-types/dist/spec/#default-policy-hdr&quot; rel=&quot;noopener&quot;&gt;default policy&lt;/a&gt;:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;trustedTypes &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;createPolicy&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Feature testing&lt;/span&gt;&lt;br /&gt;  trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createPolicy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token function-variable function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;string&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sink&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; DOMPurify&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;sanitize&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token constant&quot;&gt;RETURN_TRUSTED_TYPE&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;The policy with a name &lt;code&gt;default&lt;/code&gt; is used wherever a string is
used in a sink that only accepts Trusted Type.&lt;/p&gt;
&lt;aside class=&quot;aside flow bg-tertiary-box-bg color-tertiary-box-text&quot;&gt;&lt;p class=&quot;cluster &quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; role=&quot;img&quot; aria-label=&quot;Lightbulb&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;   &lt;path d=&quot;M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6A4.997 4.997 0 017 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Gotchas&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt; Use the default policy sparingly, and prefer refactoring the application to use regular policies instead. Doing so encourages designs in which the security rules are close to the data that they process, where you have the most context to correctly sanitize the value. &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;switch-to-enforcing-content-security-policy&quot;&gt;Switch to enforcing Content Security Policy &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#switch-to-enforcing-content-security-policy&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When your application no longer produces violations, you can start enforcing
Trusted Types:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;Content-Security-Policy: require-trusted-types-for &#39;script&#39;; report-uri //my-csp-endpoint.example&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Voila! Now, no matter how complex your web application is, the only thing that
can introduce a DOM XSS vulnerability, is the code in one of your policies - and
you can lock that down even more by &lt;a href=&quot;https://w3c.github.io/trusted-types/dist/spec//#trusted-types-csp-directive&quot; rel=&quot;noopener&quot;&gt;limiting policy creation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further reading &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/trusted-types/#further-reading&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/w3c/webappsec-trusted-types&quot; rel=&quot;noopener&quot;&gt;Trusted Types GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://w3c.github.io/trusted-types/dist/spec/&quot; rel=&quot;noopener&quot;&gt;W3C specification draft&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/w3c/webappsec-trusted-types/wiki/FAQ&quot; rel=&quot;noopener&quot;&gt;FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/w3c/webappsec-trusted-types/wiki/Integrations&quot; rel=&quot;noopener&quot;&gt;Integrations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    <author>
      <name>Krzysztof Kotowicz</name>
    </author>
  </entry>
</feed>
