{ "@context": "https://schema.org", "@id": "https://webspecification.com/spec/security/trusted-types.jsonld", "@graph": [ { "@type": "TechArticle", "@id": "https://webspecification.com/spec/security/trusted-types/#article", "headline": "Trusted Types", "description": "Trusted Types make the browser reject plain strings at DOM injection sinks like innerHTML, demanding a vetted typed value instead. Switched on with two CSP directives, it neutralises a whole class of DOM-based XSS.", "url": "https://webspecification.com/spec/security/trusted-types/", "inLanguage": "en", "isPartOf": { "@type": "WebSite", "@id": "https://webspecification.com/#website", "name": "Web Specification Studio", "url": "https://webspecification.com" }, "author": { "@type": "Person", "name": "Web Specification Studio", "url": "https://webspecification.com" }, "publisher": { "@type": "Organization", "@id": "https://webspecification.com/#organization", "name": "Web Specification Studio", "url": "https://webspecification.com" }, "license": "https://creativecommons.org/licenses/by/4.0/", "dateModified": "2026-06-23T10:00:00.000Z", "citation": [ { "@type": "CreativeWork", "name": "Trusted Types (W3C Working Draft)", "url": "https://www.w3.org/TR/trusted-types/", "publisher": { "@type": "Organization", "name": "W3C" } }, { "@type": "CreativeWork", "name": "MDN — Trusted Types API", "url": "https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API", "publisher": { "@type": "Organization", "name": "MDN" } }, { "@type": "CreativeWork", "name": "MDN — Content-Security-Policy: require-trusted-types-for", "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/require-trusted-types-for", "publisher": { "@type": "Organization", "name": "MDN" } }, { "@type": "CreativeWork", "name": "OWASP — DOM based XSS Prevention Cheat Sheet", "url": "https://cheatsheetseries.owasp.org/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.html", "publisher": { "@type": "Organization", "name": "OWASP" } } ] }, { "@type": "BreadcrumbList", "@id": "https://webspecification.com/spec/security/trusted-types/#breadcrumb", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://webspecification.com/" }, { "@type": "ListItem", "position": 2, "name": "Spec", "item": "https://webspecification.com/spec/" }, { "@type": "ListItem", "position": 3, "name": "Security", "item": "https://webspecification.com/spec/security/" }, { "@type": "ListItem", "position": 4, "name": "Trusted Types", "item": "https://webspecification.com/spec/security/trusted-types/" } ] } ] }