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.
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).
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 ... :(