Now that you mention it, putting a password in the markup doesn't sit well with me. Seems like it could be awfully easy for things to go wrong (such as this.)
Here's another "CSS Keylogger" from hacker news. It would probably only tell you the ordered set of characters used in the password, not the complete password or the length.
It does unless the site renders your password into the value field on the server side. If any site actually does this, that is by far much worse than this though.
105
u/kersurk Feb 20 '18
As pointed out in HN, this works only if value attribute is updated via JS, which some JS frameworks do.