#[snarfed]^ "The IETF Standards Process...requires at least two independent and inter-operable implementations," 😆 well yeah I guess that's a minimum bar
#aaronpkthe documentation of the interoperable implementations is not great, and the process of actually verifying that could be a lot better
[fluffy] joined the channel
#[fluffy]oh yeah the http://huntr.dev folks assigned a CVE after all, it was just a bug that it hadn’t been originally. And now I feel like I’ve finally made it: a piece of software I wrote is widely-used enough that people bothered to find an issue with it and open a CVE against it!
#Loqi[preview] [elle mundy] who called it object oriented programming and not class struggle
IWSlackGateway, geoffo, [snarfed], bterry, [jgarber], [jacky] and [fluffy] joined the channel
#[fluffy]It still baffles me that browser Javascript still has no built-in way to escape HTML entities.
#sknebelTIL the Sanitizer API is still experimental and not widely supported
#sknebel(which was my first thought for that problem, even though kinda overkill)
[aciccarello] joined the channel
#[aciccarello]You'd think that'd be a priority API to finalize
#sknebelnot sure how much it'd be actually used? insert HTML snippets directly? (since its much more than just escaping, but you can make it do that too I think)
#ZegnatWhat is the usecase? Inserting potential HTML as text? I think the "correct" way to do that is createTextNode, where you can safely use < and >. For almost everything else the correct way is to write out the unicode symbol and not create HTML entities.
[jamietanna] joined the channel
#[jamietanna]Snarfed did I remember seeing you'd recently shipped a big change to Bridgy Fed? I'm currently seeing my "notifications" feed as including a lot of other folks' content 🤔
#[fluffy]I’m not a fan of using the DOM methods for generating things, though. It’s unnecessarily verbose/unwieldy and usually slower than just shoving a text string at .innerHTML or whatever.
#Zegnat.innerText is the text node equivilent to innerHTML, but of course if you want to do a mix of HTML and escaped strings it gets a little trickier
#[fluffy]yeah I just played with it on jsFiddle and it worked fine. I just don’t like the DOM manipulation methods and I’d much rather just build strings template-style.
#[fluffy]Especially since JS supports string interpolation nowadays.
#[fluffy]sometimes you just want to bash out some HTML.
bterry joined the channel
#ZegnatI can see that. But just as with SQL, or almost anything else with a syntax, you are going to have to introduce sanitation somewhere, haha
#[fluffy]sure, and it’d be better to make the sanitization API easy to use rather than having to contort around everything
#[fluffy]like with SQL, sure, use parameter binding, not code generation.
#[fluffy]If Javascript had an equivalent to that for HTML generation, I’d be fine with it!
#[fluffy]I just find it really weird that there’s no standard function for converting a text string into entity-escaped or URL-encoded as another text string. Both of those come up *all the time* in webapps, and the lack of standard functionality is probably where a lot of XSS issues come from.