New blog post: Perfect types with `setHTML()` - https://frederikbraun.de/perfect-types-with-sethtml.html - TLDR: Use require-trusted-types-for 'script'; trusted-types 'none'; in your CSP and nothing besides setHTML() works, essentially removing all DOM-XSS risks....
Perfect types with `setHTML()`

Perfect types with `setHTML()`

Frederik Braun
@freddy fyi there's a minor typo with your csp string under the Trusted Types heading. You're missing the closing the ';
@Lukew fixed, thanks. (and this is why nobody should be writing content security policies :))
@freddy How is 3. a concern, if you can't parse any strings?
@evilpie right.. 😅
@evilpie would be pretty bad if repeatedly parsing through setHTML could even have that issue. thanks.
@freddy yeah. I am glad you published this idea as blog post.