Trusted Types aims to prevent DOM-based cross-site scripting (DOM XSS) by introducing a new API for creating string-wrapping objects that can only be used in safe ways. It allows defining policies that create these trusted types, limiting where DOM XSS can be introduced. With enforcement, web platforms would only accept trusted types for DOM sinks like innerHTML, reducing the attack surface. Policies can be guarded and their creation controlled via response headers to further limit security risks. Initial implementations show it can help secure applications with minimal changes.
Related topics: