News for hackers. Stuff that matters.
Re:Ask HN: Dark mode for HN please? by toupeira on Friday May 15, 2020 @08:51PM (#23199367)
Reddit's user CSS was different, mods could edit it on subreddits and all visitors would receive it. On HN you'd only get the CSS you've set yourself, so there shouldn't really be a security concern (except for CSRF attacks against the settings form I guess).
Re:Ask HN: Dark mode for HN please? by dang on Friday May 15, 2020 @09:10PM (#23199478)
Thanks—that's an important clarification, and maybe is the thing to do after all.
Re:Ask HN: Dark mode for HN please? by kazinator on Saturday May 16, 2020 @12:48PM (#23205031)
Not so fast! Just because the CSS is only served to the authenticated account which installed it doesn't necessarily mean things are 100% okay.

There could be cross-site scripting attacks whereby the user clicks on something evil in a malicious site which attacks that user's HN authenticated session by installing some malicious CSS in their profile. The UI could require a confirmation of the account password for updating any security-sensitive properties.

Users could also shoot themselves in the foot with bad CSS. The obvious fix for that is that the profile settings page itself doesn't inject the CSS, or there is a safe variant of its URL which doesn't inject CSS.

Re:Ask HN: Dark mode for HN please? by dang on Monday May 18, 2020 @01:18PM (#23225333)
Two great points. Thanks.
Re:Ask HN: Dark mode for HN please? by fiddlerwoaroof on Friday May 15, 2020 @10:26PM (#23199935)
I would really like to see this: maybe release a "submit CSS blob" feature first and then, in a couple months, have a competition to pick the best style sheet?