News for hackers. Stuff that matters.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by afavour on Tuesday February 24, 2026 @10:47AM (#47138602)
> Who would ever want this?

Anyone who wants to provide some level of flexibility but within bounds. Say, you want to allow <strong> and <em> in a forum post but not <script>. It's not too difficult to imagine uses.

Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by goatlover on Tuesday February 24, 2026 @01:03PM (#47140368)
Forums would already have code that sanitizes user input when it's submitted. Users aren't directly setting html elements.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by afavour on Tuesday February 24, 2026 @01:10PM (#47140447)
And is that sanitization perfect? Kept up to date?

With a safe API like this one that's tied to the browser's own interpretation of HTML (i.e. it is perfectly placed to know exactly what is and isn't dangerous given it is the one rendering it) wouldn't it be much better to rely on that?