Problem/Motivation

When an admin is adding a new user to the website, the browser will often try to autocomplete the password according to the admin's password.

Proposed resolution

Use automcomplete="new-password" in the password field, in order to disable autocomplete and most modern browsers will actually suggest generating a new password.

This is an upcoming feature in Chrome and Firefox:
https://www.caniuse.com/#feat=mdn-html_global_attributes_autocomplete_ne...

(IE11 does not support it, but this wouldn't degrade the existing user experience)

To read more about this feature:
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site...

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

shaal created an issue. See original summary.

shaal’s picture

Status: Active » Needs review
StatusFileSize
new1.44 KB
joum’s picture

Hi shaal!

Tested it against 8.7.8 and it looks good. The autocomplete attribute has the 'new-password' value.

Although, neither Firefox 70 nor Chrome 78.0.3904.70 on macOS 10.13.6 suggested a new password generation at first try.

I managed to get it working on FF after enabling new password generation in the config, but it wasn't enabled by default.

Couldn't get it to work on Chrome, though.

Let me know if there's anything I can help with, but on my end, +1

Cheers!

kostask’s picture

Status: Needs review » Reviewed & tested by the community

The patch looks good, it adds the autocomplete attribute with value 'new-password'.

on MacOs:
FF 70 does indeed prompt to generate a secure password
Chrome & Safari 78 did not try to autocomplete the password

but Canary did try to autocomplete the password.

As it offers a better UX for modern browsers I think this is RTBC.

alexpott’s picture

Adding credit for @kostask and @joum both of whom provided evidence of testing the patch.

I see no harm in adding this. But one thought that needs to be considered is whether or not the password_confirm input is solely used for new passwords. In core it definitely is but what about contrib. I've searched http://grep.xnddx.ru/search?text=password_confirm&filename=&page=4 and cannot find any examples in contrib where it is been used for existing passwords. And even if so then the value would be filled and then autocomplete does not mean anything. So this looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 7403764a0c to 9.0.x and b36cfe8528 to 8.9.x. Thanks!

  • alexpott committed 7403764 on 9.0.x
    Issue #3091284 by shaal, joum, kostask: Prevent autofilling passwords...

  • alexpott committed b36cfe8 on 8.9.x
    Issue #3091284 by shaal, joum, kostask: Prevent autofilling passwords...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.