Trusted Types Reaches Full Browser Support, Turning DOM XSS Into a TypeError
The Trusted Types API, a browser security feature that blocks dangerous DOM injection via raw strings, achieved Baseline status in February 2026 when Firefox 148 added support, completing coverage across all major browsers. Chrome and Edge had supported it since 2020, with Safari joining in version 26. The API works by enforcing that only values created through explicitly declared policies can be passed to risky sinks like innerHTML, outerHTML, and eval — raw strings now throw a TypeError. Developers can enable it via a Content-Security-Policy header, and are advised to start with report-only mode to identify violations before switching to full enforcement. Trusted Types does not sanitize content itself, but it narrows the entire DOM XSS attack surface to a small set of named policy functions that can be audited quickly.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in