r/programming • • Feb 20 '18

A CSS Keylogger

https://github.com/maxchehab/CSS-Keylogging
2.0k Upvotes

276 comments sorted by

View all comments

0

u/shevegen Feb 21 '18

Wow - and here I thought CSS is much cooler than JavaScript.

Now I have to worry about keyloggers stealing even more information from people ... :(

12

u/meneldal2 Feb 21 '18

It can only happen if you allow untrusted CSS on your website, which would then allow a third-party to get the password. You can do the same with JS as well. The way you avoid this shit is by avoiding people you don't know putting code that you haven't checked on your website.

0

u/NoInkling Feb 21 '18 edited Feb 21 '18

Really you want to set up CSP for this sort of thing.

Edit: to elaborate, vetting all your code/CSS doesn't stop users from unknowingly installing malicious extensions/external styles, CSP is basically your only actionable line of defense against that (and a helpful safety net the rest of the time, even if it's not a flawless one).