If a browser is set to autofill passwords, it may autofill a field used for key events and become text input for the device
Don't know how the password is getting displayed whenever we access some devices. If we access browser it comes in url section. This looks like adb shell input text
Please find the video in pptx. ldap_video_Presentation.pptx
We have cluster setup and inside auth service we kept the LDAP user password same get's displayed to user who use the device. Please need a solution for this.
Steps to reproduce :
- click on device
- launch with browser and type the password

We don't do anything like that. However, to accept input from the device, there's a hidden password field that gets focused when you click on the screen. It's a password field because that had the least cross-browser and non-Latin issues. What I think is happening is that your browser is simply autofilling the password field. This then is translated to key events.
(the password field is only for accepting key events, and isn't actually a password)
Is there any way to stop this as it only reads the value from password field? I am using my credential for LDAP auth and same using for login in stf :)
@tadesushilgithub What browser are you using?
We might just add an autocomplete="off" to the input field here
However it looks like new Chrome versions are ignoring it, so we will need to do cross-browser testing before doing it. Unfortunately its one of those places that its not possible to do automated testing. http://stackoverflow.com/questions/15738259/disabling-chrome-autofill
Thanks @gunta I am using Mozilla Firefox 51.0.1.
The Firefox password autofill can be incredibly aggressive, filling in any <input type="password"> in the page, and even filling the preceding field (if there is one) with your username. One workaround may be to insert the field with type="text" and then (almost immediately) change the type to password in JS, though I'm not sure how that would affect the cross-browser and non-Latin issues referred to above. It might be worth testing, though, if you haven't yet found a better solution for this issue.
Issue confirmed on Google Chrome 63.0.3239.84.
Apart from the autocomplete popup being really annoying, the fact that the password autocomplete inserts a saved password to the application with on wrong click is a serious problem for me.
As we use STF on a company domain, all the other company system's login details are offered.
Using a password field for this is a very bad idea, but if you must, autocomplete="new-password" is how you can turn it off on newer browsers: https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields
Guys, there's a reason why we originally chose a password field. It was and perhaps still is one of the only ways to get latin characters when someone is using an IME, e.g. with Japanese. Furthermore, at the time autocomplete off actually did what it's supposed to do.
Now, does anyone have an alternate, tested, complete solution that works in all reasonably recent browsers right now? It sounds to me like new-password isn't well supported yet. A PR would be greatly appreciated.
So when you focus a password field, the browser automatically switches to a latin keyboard layout for you. This is a convenient feature, sure. But if you want to type a comment in English right here, you have to switch to a latin layout, no? Why can't you do the same in STF? IMHO not having our passwords exposed like that is more important than automatically switching to a latin keyboard if someone happens to be using an IME. We fixed this by monkeypatching stf's js code on startup:
Put this into the systemd config of stf-app
ExecStartPost=/usr/local/bin/stfinputhack.sh %p-%i
And save this as /usr/local/bin/stfinputhack:
#!/bin/sh
sleep 10
/usr/bin/docker exec --user 0 "$1" sh -c 'cd /app/res/build && for file in *.js; do perl -pi -e "s|type=\\\\\"password\\\\\"([^>]*?)(\\\$root\.screenFocus\\\\\")|type=\\\\\"text\\\\\"\1\2|" "$file";done'
I also tried type="tel", type="url" and type="email", but none of those autoswitched like type="password". So I'm sorry, but the perfect solution you're looking for doesn't seem to exist, at least not in browsers that don't support ime-mode. new-password might also be problematic because the browser might show some ui to generate a new password, or it might save the new password into its password manager.