đź’¦ FULL SET: TR/trusted types - Full Archive
Trusted Types
More details about this document
- This version:
- https://www.w3.org/TR/2025/WD-trusted-types-20251103/
- Latest published version:
- https://www.w3.org/TR/trusted-types/
- Editor's Draft:
- https://w3c.github.io/trusted-types/dist/spec/
- Previous Versions:
- https://www.w3.org/TR/2025/WD-trusted-types-20251028/
- History:
- https://www.w3.org/standards/history/trusted-types/
- Feedback:
- public-webappsec@w3.org with subject line “[trusted-types] … message topic …” (archives)
- GitHub
- Inline In Spec
- GitHub
- Editor:
- Former Editor:
- Test Suite:
- https://wpt.fyi/results/trusted-types/
Copyright © 2025 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.
Abstract
An API that allows applications to lock down powerful APIs to only accept non-spoofable, typed values in place of strings to prevent vulnerabilities caused by using these APIs with attacker-controlled inputs.
Status of this document
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index.
This document was published by the Web Application Security Working Group as a Working Draft using the Recommendation track. This document is intended to become a W3C Recommendation.
The (archived) public mailing list public-webappsec@w3.org (see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “trusted-types” in the subject, preferably like this: “[trusted-types] …summary of comment…”
Publication as a Working Draft does not imply endorsement by W3C and its Members. This is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to cite this document as other than a work in progress.
This document was produced by the Web Application Security Working Group.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 18 August 2025 W3C Process Document.
Tests
- DOMParser-parseFromString-regression.html (live test) (source)
- DOMParser-parseFromString.html (live test) (source)
- DedicatedWorker-block-eval-function-constructor.html (live test) (source)
- DedicatedWorker-constructor-from-DedicatedWorker.html (live test) (source)
- DedicatedWorker-constructor-from-SharedWorker.html (live test) (source)
- DedicatedWorker-constructor.https.html (live test) (source)
- DedicatedWorker-eval.html (live test) (source)
- DedicatedWorker-importScripts.html (live test) (source)
- DedicatedWorker-setTimeout-setInterval.html (live test) (source)
- Document-execCommand.html (live test) (source)
- Document-write-appending-line-feed.html (live test) (source)
- Document-write-exception-order.xhtml (live test) (source)
- Document-write.html (live test) (source)
- Element-insertAdjacentHTML.html (live test) (source)
- Element-outerHTML.html (live test) (source)
- Element-setAttribute-respects-Elements-node-documents-globals-CSP-after-adoption-from-TT-realm.html (live test) (source)
- Element-setAttribute-respects-Elements-node-documents-globals-CSP-after-adoption-from-non-TT-realm.html (live test) (source)
- Element-setAttribute.html (live test) (source)
- Element-setAttributeNS.html (live test) (source)
- Element-toggleAttribute.html (live test) (source)
- GlobalEventHandlers-onclick.html (live test) (source)
- HTMLElement-generic.html (live test) (source)
- HTMLScriptElement-in-xhtml-document.tentative.https.xhtml (live test) (source)
- HTMLScriptElement-internal-slot.html (live test) (source)
- Node-multiple-arguments-tt-enforced.html (live test) (source)
- Node-multiple-arguments.html (live test) (source)
- Range-createContextualFragment.html (live test) (source)
- SVGScriptElement-internal-slot.html (live test) (source)
- ServiceWorker-block-eval-function-constructor.https.html (live test) (source)
- ServiceWorker-eval.https.html (live test) (source)
- ServiceWorker-importScripts.https.html (live test) (source)
- ServiceWorkerContainer-register-from-DedicatedWorker.https.html (live test) (source)
- ServiceWorkerContainer-register-from-ServiceWorker.https.html (live test) (source)
- ServiceWorkerContainer-register-from-SharedWorker.https.html (live test) (source)
- ServiceWorkerContainer-register.https.html (live test) (source)
- SharedWorker-block-eval-function-constructor.html (live test) (source)
- SharedWorker-constructor.https.html (live test) (source)
- SharedWorker-eval.html (live test) (source)
- SharedWorker-importScripts.html (live test) (source)
- SharedWorker-setTimeout-setInterval.html (live test) (source)
- TrustedType-AttributeNodes.html (live test) (source)
- TrustedTypePolicy-CSP-no-name.html (live test) (source)
- TrustedTypePolicy-CSP-wildcard.html (live test) (source)
- TrustedTypePolicy-createXXX.html (live test) (source)
- TrustedTypePolicyFactory-constants.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-createXYZTests.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests-none-none-name.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests-none-none.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests-none-skip.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests-none.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-cspTests.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-non-tt-policy-name.html (live test) (source)
- TrustedTypePolicyFactory-createPolicy-unenforced.html (live test) (source)
- TrustedTypePolicyFactory-defaultPolicy.html (live test) (source)
- TrustedTypePolicyFactory-getAttributeType-namespace.html (live test) (source)
- TrustedTypePolicyFactory-getAttributeType-svg.html (live test) (source)
- TrustedTypePolicyFactory-getAttributeType.html (live test) (source)
- TrustedTypePolicyFactory-isXXX.html (live test) (source)
- Window-TrustedTypes.html (live test) (source)
- Window-block-eval-function-constructor.html (live test) (source)
- Window-setTimeout-setInterval.html (live test) (source)
- block-Document-execCommand.html (live test) (source)
- block-string-assignment-to-DOMParser-parseFromString.html (live test) (source)
- block-string-assignment-to-DedicatedWorker-setTimeout-setInterval.html (live test) (source)
- block-string-assignment-to-Document-parseHTMLUnsafe.html (live test) (source)
- block-string-assignment-to-Document-write.html (live test) (source)
- block-string-assignment-to-Element-insertAdjacentHTML.html (live test) (source)
- block-string-assignment-to-Element-outerHTML.html (live test) (source)
- block-string-assignment-to-Element-setAttribute.html (live test) (source)
- block-string-assignment-to-Element-setAttributeNS.html (live test) (source)
- block-string-assignment-to-Element-setHTMLUnsafe.html (live test) (source)
- block-string-assignment-to-HTMLElement-generic.html (live test) (source)
- block-string-assignment-to-HTMLIFrameElement-srcdoc.html (live test) (source)
- block-string-assignment-to-Range-createContextualFragment.html (live test) (source)
- block-string-assignment-to-ShadowRoot-innerHTML.html (live test) (source)
- block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html (live test) (source)
- block-string-assignment-to-SharedWorker-setTimeout-setInterval.html (live test) (source)
- block-string-assignment-to-Window-setTimeout-setInterval.html (live test) (source)
- block-string-assignment-to-attribute-via-attribute-node.html (live test) (source)
- block-string-assignment-to-text-and-url-sinks.html (live test) (source)
- block-text-node-insertion-into-script-element.html (live test) (source)
- block-text-node-insertion-into-svg-script-element.html (live test) (source)
- csp-block-eval.html (live test) (source)
- default-policy-callback-arguments.html (live test) (source)
- default-policy-report-only.html (live test) (source)
- default-policy.html (live test) (source)
- empty-default-policy-report-only.html (live test) (source)
- empty-default-policy.html (live test) (source)
- eval-csp-no-tt.html (live test) (source)
- eval-csp-tt-default-policy-mutate.html (live test) (source)
- eval-csp-tt-default-policy.html (live test) (source)
- eval-csp-tt-no-default-policy.html (live test) (source)
- eval-function-constructor-untrusted-arguments-and-applying-default-policy.html (live test) (source)
- eval-function-constructor-untrusted-arguments-and-default-policy-throwing.html (live test) (source)
- eval-function-constructor.html (live test) (source)
- eval-no-csp-no-tt-default-policy.html (live test) (source)
- eval-no-csp-no-tt.html (live test) (source)
- eval-with-permissive-csp.html (live test) (source)
- get-trusted-types-compliant-attribute-value.html (live test) (source)
- idlharness.window.js (live test) (source)
- inheriting-csp-for-local-schemes.html (live test) (source)
- legacy-trusted-script-urls.html (live test) (source)
- legacy-trusted-scripts.html (live test) (source)
- modify-attributes-in-callback.html (live test) (source)
- no-require-trusted-types-for-report-only.html (live test) (source)
- no-require-trusted-types-for.html (live test) (source)
- require-trusted-types-for-TypeError-belongs-to-the-global-object-realm.html (live test) (source)
- require-trusted-types-for-report-only.html (live test) (source)
- require-trusted-types-for.html (live test) (source)
- script-enforcement-001-outerHTML.xhtml (live test) (source)
- script-enforcement-001.html (live test) (source)
- script-enforcement-002-outerHTML.xhtml (live test) (source)
- script-enforcement-002.html (live test) (source)
- script-enforcement-003.html (live test) (source)
- script-enforcement-004.html (live test) (source)
- script-enforcement-005.html (live test) (source)
- script-enforcement-006.html (live test) (source)
- script-enforcement-007.html (live test) (source)
- script-enforcement-008.https.html (live test) (source)
- script-enforcement-009.https.html (live test) (source)
- script-enforcement-010.html (live test) (source)
- script-enforcement-011.html (live test) (source)
- set-attributes-no-require-trusted-types.html (live test) (source)
- set-attributes-require-trusted-types-default-policy.html (live test) (source)
- set-attributes-require-trusted-types-no-default-policy.html (live test) (source)
- should-sink-type-mismatch-violation-be-blocked-by-csp-001.html (live test) (source)