I have been helping out some people with their computers and repairing them. One of these people asked me about the safety of storing passwords in the auto form field. I showed them a quick trick on how you can retrieve the password from a simple jQuery call in the console. While working on some websites, I have been trying to figure out a way of preventing the use of this trick to find out what the saved password is.
To understand what im talking about if you dont know, try the following.
- Navigate to a website with jquery (or jquerify the site) and either have auto form fill in turned on or fill in the password field.
- inspect element to show the password id field or some way to call the field with jquery
- in console run something like
$('#password').val()
and watch the password show up.
I am wondering if there is some way for me as a web developer to prevent the use of this on my site but still allow the use of it for getting the value of the field within the site code.
Thanks.
EDIT
From facebook with login autofilled out (blacked out for security)
and then after jquerifying the page and running the $jq('#pass').val()
in console without changing anything (password blacked for security)
USE CASE
User 1 is on public computer, they allow the browser to save login info
User 1 leaves, User 2 goes to same site. browser auto fills in login info
User 2 runs the command and gains access to the password