Now you can, and that is stupid. To enable headless mode should require root.
Now you can, and that is stupid. To enable headless mode should require root.
This may be a more convenient way to do so, but ultimately it's an attack that's rather hard to defend against under the usual desktop user-based access control model.
[0] https://security.stackexchange.com/a/170485/117977
[1] Code that shows, say, a false user login screen or exploits a previously unknown OS vuln to escalate privileges.
or you could go to the site, autofill the password, then extract the password input's value using the dev console.
kidding aside, this could be run from a USB key, automatically, in a very stealthy way. so yeah, worse.
Are you actually able to reproduce?
Edit: It works if you change the input type. Sigh. The web is brutal.
var inputs = document.getElementsByTagName('input'); for(var i = 0; i < inputs.length; i++) { if(inputs[i].type.toLowerCase() == 'password') { alert(inputs[i].value); } }