Trusted Types Playground

The Pos Ronda notice board: a notice through the real trustedTypes.createPolicy. See what createHTML returns, and whether a passthrough policy still guards…

Why it matters

DOM XSS happens when untrusted data reaches a sink like innerHTML. Trusted Types turns those hundreds of points into one review: a sink only takes a value from a policy. But it forces a policy to exist, not that the policy is right, needs a CSP to be active, and must be feature-detected. Misreading this makes people think XSS is solved when it is not.

The key idea

Trusted Types forces sinks through a policy; it does not sanitise for you

Common mistakes

Try it in this playground