Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection...
by entuno on Tuesday February 24, 2026 @12:12PM
(#47139636)
It's certainly an improvement over people trying to homebrew their own sanitisers. But that distinction of being XSS-safe is a potentially subtle one, and could end up being dangerous if people don't carefully consider whether XSS-safe is good enough when they're handling arbitrary users input like that.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection...
by intrasight on Tuesday February 24, 2026 @12:21PM
(#47139775)
Also has made me nervous for years that there's been no schema against which one can validate HTML. "You want to validate? Paste your URL into the online validation tool."
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection...
by Dylan16807 on Tuesday February 24, 2026 @04:22PM
(#47143252)
This help? https://github.com/validator/validator
But for html snippets you can pretty much just check that tags follow a couple simple rules between <> and that they're closed or not closed correctly.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection...
by intrasight on Tuesday February 24, 2026 @04:50PM
(#47143704)
That app does look helpful!
[1] https://developer.mozilla.org/en-US/docs/Web/API/Element/set...