r/javascript • • Feb 20 '18

A CSS Keylogger.

https://github.com/maxchehab/CSS-Keylogging
696 Upvotes

95 comments sorted by

View all comments

3

u/[deleted] Feb 20 '18

[removed] — view removed comment

2

u/CodeFightDance Feb 20 '18

I'm confused as to why it works on the instagram site at all, which is the only site I've been able to get it to work on.

But with some simple JS you could just re-run the css rules, like in this stackoverflow

https://stackoverflow.com/questions/10645552/is-it-possible-to-use-an-input-value-attribute-as-a-css-selector

3

u/[deleted] Feb 20 '18

[removed] — view removed comment

1

u/profound7 Feb 21 '18

Some sites uses view engines like React, Angular, Vue etc... and in such frameworks it is possible to do data binding to attributes, which can update the attribute as you type.

The actual web developers may bind a variable to the password's value attribute, perhaps for client-side validation or clearing the password field, without thinking or knowing of the consequences it could bring.

In Vue, you can easily create a 2-way data binding using the v-model attribute. So I guess those who used v-model for whatever reason on their password fields are vulnerable to this. I believe it would be similarly easy to do that in React and Angular also.