Don't autofill in password fields with an autocomplete field name of "new-password"
Categories
(Toolkit :: Password Manager, defect, P2)
Tracking
()
People
(Reporter: MattN, Assigned: sfoster)
References
(Depends on 2 open bugs, Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, Whiteboard: [passwords:heuristics])
Attachments
(1 file)
Updated•10 years ago
|
Reporter | ||
Updated•10 years ago
|
Reporter | ||
Comment 2•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment 10•8 years ago
|
||
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
Comment hidden (advocacy) |
Comment hidden (advocacy) |
Comment 21•7 years ago
|
||
Comment 22•7 years ago
|
||
Comment hidden (advocacy) |
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
Comment 29•6 years ago
|
||
Comment 30•6 years ago
|
||
Comment 31•6 years ago
|
||
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Comment 32•6 years ago
|
||
You can get the parsed @autocomplete value with input.getAutocompleteInfo().fieldName
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 33•6 years ago
|
||
I'm thinking that we probably want a new AUTOFILL_RESULT for the autocomplete=new-password case. That way it fits the existing logic in _fillForm and if I'm reading this correctly we also get telemetry for this outcome. Is there any issue I'm missing with just creating a AUTOFILL_RESULT.PASSWORD_AUTOCOMPLETE_NEW_PASSWORD or something like that?
Reporter | ||
Comment 34•6 years ago
|
||
That should be fine and would be a good idea.
Assignee | ||
Comment 35•6 years ago
|
||
- Add form autofill outcome AUTOFILL_RESULT.PASSWORD_AUTOCOMPLETE_NEW_PASSWORD
- Autocomplete behavior is not changed
Comment 38•6 years ago
|
||
Comment 40•6 years ago
|
||
Backed out changeset 32c7dc092efd (bug 1119063) for failing test_autocomplete_new_password.html
push that caused the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&selectedJob=230887270&revision=32c7dc092efda4c745b4b1fe3590249d0d0513df
backout: https://hg.mozilla.org/integration/autoland/rev/03d6fa61c83594e678952a3f8bc275e9b5e3a614
Assignee | ||
Comment 41•6 years ago
|
||
Thanks for the backout. I've re-submitted it with that test skipped for android.
Comment 42•6 years ago
|
||
Comment 43•6 years ago
|
||
bugherder |
Comment 44•6 years ago
|
||
The password fields with autocomplete="new-password" will not autofill while the password fields with autocomplete="off" will autofill as intended. in Nightly v68.0a1 and Beta v67.0b4.
Tested using the following test page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form method="POST" action="./">
<h1>Single password field has name="new-password"</h1>
<p>
<input type="password" autocomplete="new-password">
</p>
<p>
<input type="submit" value="Login">
</p>
</form>
</body>
</html>
Does this cover everything? I don's see if there could be any edge cases that might need testing? Are there?
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Comment 45•6 years ago
•
|
||
You could test configurations like a password change form:
- current-password or no @autocomplete
- new-password
- new-password
Comment 46•6 years ago
•
|
||
I have also tested the new-password and confirm-password fields form from changing a Google, Yahoo and Reddit account's password. These fields are not being auto-completed.
In the case of the Reddit "update your password" form, the current (about to be changed) password field was auto-filled and this is expected, while the "new password" and "verify password" fields are not being auto-filled.
Based on all the above, this issue is now considered verified in Nightly v68.0a1 and Beta v67.0b5.
Comment 47•6 years ago
|
||
Docs needs to be updated:
If you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use
autocomplete="new-password"
; however, support for this value has not been implemented on Firefox.
This is already documented at https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete , but I don't see any browser compat table on that page.
Comment 48•6 years ago
|
||
We also have a dedicated page for the autocomplete attribute — https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete — but this is also lacking in the usual browser compat/specs information. We'll fix this in the next cycle.
Comment 49•6 years ago
|
||
Note added to Fx67 rel notes: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/67#HTML
Reporter | ||
Comment 50•6 years ago
|
||
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #49)
Note added to Fx67 rel notes: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/67#HTML
This bug is about autofill, not autocomplete so I updated the text to reflect that. We will still offer the password in autocomplete to deal with sites who abuse this value since we ignore autocomplete="off". Feel free to re-word it.
Comment 51•6 years ago
|
||
This bug is about autofill, not autocomplete so I updated the text to reflect that. We will still offer the password in autocomplete to deal with sites who abuse this value since we ignore autocomplete="off". Feel free to re-word it.
Ah, I misread that — thanks for the clarification :MattN! I have tweaked the note slightly; looks fine now.
Comment 52•6 years ago
|
||
OK, so I think the docs are done for this one.
I've updated the autocomplete page to include an example, specifications, and browser compat data section. I also made sure the wording looked good:
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
I submitted a PR to add the actual compat data to our repo:
https://github.com/mdn/browser-compat-data/pull/4108/files
Finally, I updated the wording in the following section (as recommended by :robwu, thanks for the pointer!):
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields
Let me know if the wording looks ok - thanks!
Reporter | ||
Comment 53•6 years ago
|
||
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #52)
OK, so I think the docs are done for this one.
Thanks!
I've updated the autocomplete page to include an example, specifications, and browser compat data section. I also made sure the wording looked good:
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
I'm not sure if this was an existing issue but the autocomplete
attribute isn't only for <input>
like the page says/implies a few times.
Comment 54•6 years ago
|
||
I'm not sure if this was an existing issue but the autocomplete attribute isn't only for <input> like the page says/implies a few times.
This is a good point. I've updated the wording accordingly throughout the article to take into account textarea and form elements too.
Comment 55•6 years ago
|
||
Could you link to the new compat table from the last paragraph at https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields , so that readers can know which browsers support "new-password"
?
The current article doesn't link to the autocomplete
documentation at all, so the information is not easy to find.
Comment 56•6 years ago
|
||
(In reply to Rob Wu [:robwu] from comment #55)
Could you link to the new compat table from the last paragraph at https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields , so that readers can know which browsers support
"new-password"
?
The current article doesn't link to theautocomplete
documentation at all, so the information is not easy to find.
Done; I've added a general link to this page higher up too.
Comment 57•6 years ago
|
||
And to make the cycle complete, could you link to The_autocomplete_attribute_and_login_fields from the "new-password" section of the autocomplete
docs? There is already a notice at "off", but given the detail in that separate page, linking to it from "new-password"
seems useful too.
I should have mentioned that in my previous comment; I hope that spreading it over two comments did not inconvenience you.
Comment 58•6 years ago
|
||
(In reply to Rob Wu [:robwu] from comment #57)
And to make the cycle complete, could you link to The_autocomplete_attribute_and_login_fields from the "new-password" section of the
autocomplete
docs? There is already a notice at "off", but given the detail in that separate page, linking to it from"new-password"
seems useful too.I should have mentioned that in my previous comment; I hope that spreading it over two comments did not inconvenience you.
No worries at all! Link added to the "new-password" value entry.
Reporter | ||
Comment 59•6 years ago
•
|
||
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #54)
I'm not sure if this was an existing issue but the autocomplete attribute isn't only for <input> like the page says/implies a few times.
This is a good point. I've updated the wording accordingly throughout the article to take into account textarea and form elements too.
You forgot about <select>
which I have now added.
Comment 60•6 years ago
|
||
(In reply to Matthew N. [:MattN] (PM me if requests are blocking you) from comment #59)
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #54)
I'm not sure if this was an existing issue but the autocomplete attribute isn't only for <input> like the page says/implies a few times.
This is a good point. I've updated the wording accordingly throughout the article to take into account textarea and form elements too.
You forgot about
<select>
which I have now added.
Ah, thanks, appreciate it. I missed it because it wasn't listed in the list at https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes; I've added it there too.
Comment 61•4 years ago
|
||
(In reply to RedScourge from comment #30)
Really what would be an optimal solution would be if a new type=obscuredtext
option and a new type=username option were added to the HTML standard, and
thereafter type=username and type=password would become the standard field
types for web developers to use for login form username and password values,
and the standard field types to trigger browser password managers. This
would free up everyone from the confusion of knowing whether a given
type=text field is supposed to be a login form username,
and whether a given type=password field is supposed to be for a login form
password or if the web developer had some other intended purpose to obscure
a field.This solution would allow there to never be any doubt in the minds either of
web developers or browser developers what the intention of these form field
are, and which form fields the password manager may/should attempt to use
and which it should not. While having the added bonus of making HTML more
semantically intuitive, and the added bonus of eventually allowing browser
developers to remove the code which tries to figure out which text field to
treat as a username whenever a password field is present in a given form,
most importantly it would completely prevent a potential arms race between
web developers who may want a particular obscured text field to not trigger
the browser's password manager for some reason, and browser developers
wanting to trigger the password manager on every form containing a
type=password field in case a user might want it to, regardless of any
problems caused in certain applications.It would however be difficult and time consuming to get everyone else on
board with altering the HTML standard accordingly, so a good compromise
would probably be to implement the already existing and increasingly
supported autocomplete=new-password functionality instead.
How would an 'obscuredtext' type be different to honouring autocomplete="off" on password type fields?
The real problem is that browser developers have decided that preventing websites from disabling autofill on login pages is more important than honouring the correctly expressed semantics of well built web pages.
Just posting my 2 cents since I ran into this issue on my application. My developer's solution was to add hidden fields that get autofilled instead of the 'real' fields and I'm not happy with that.
Comment hidden (Intermittent Failures Robot) |
Comment 63•1 years ago
|
||
Removing the [stockwell disable-recommended] tag as it was caused by a spam user starring jobs against this bug.
Sorry for the inconvenience!
Description
•