| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | other |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | Privacy improvements, refactor account workflow |
Issue Summary
(coming from #1359718: Password reset fails when a user has a username that matches another user's email address)
On 'Request new password' form (/user/password), you get the following message if you enter a unused mail address or username:
Sorry, john.doe@example.com is not recognized as a user name or an e-mail address.
If you enter a used mail address or username, you get:
Further instructions have been sent to your e-mail address.
So, an anonymous user can easily check whether there is a user registered with a certain e-mail-address or not.
I think this can be a privacy issue. Think of the following scenario:
Alice wants to check if her fiancé Bob is registered at "adult-dating.example.com", a well known Internet dating site run by Drupal. She visits adult-dating.example.com/user/password and enters his mail address bob@doe-family.example. If she gets the message "Further instructions have been sent to your e-mail address.", she'll know that there is a user registered with Bobs mail address (= Bob himself) or with a username matching his mail address (unlikely that it would be someone else).
Possible solution:
never print "Sorry, XYZ is not recognized as a user name or an e-mail address.",
always print "Further instructions have been sent to your e-mail address.".
Maybe we should change the wording of this message then (adding something like "if matched any account").
Remaining tasks
- (novice) Issue summary needs updating with issue summary template (how to: http://drupal.org/node/1427826)
- (novice) document/update steps to test/reproduce (how to: http://drupal.org/node/1468198)
- (novice) manual testing (how to: http://drupal.org/node/1489010)
- (novice) check coding standards and documentation (how to: http://drupal.org/node/1487976)
- Writing more tests? Needs a test only patch so the bot can show it fails. (how to: http://drupal.org/node/1468170)
- Needs an interdiff (how to: http://drupal.org/node/1488712)
Comments
#1
Good and important suggestion. :-)
#2
How about if it says "Further instructions have been sent to emailhere@emaildomain.com." in both cases (the email does exist and the email does not exist). If emailhere@emaildomain.com contains a typo, this gives the user the opportunity to realize that they have mis-typed their email address and need to try again. If this was an attempt to obtain membership information, no such information has been exposed.
#3
+1 for this issue
i made a patch for it, containing the following changes:
#4
#5
The last submitted patch, user_reset_password_privacy-1521996-3.patch, failed testing.
#6
I agree with the privacy issue.
I can imagine a lot of strategies how to handle the password reset in different ways.
The default handling of the core should be very save (like the strategy above) and a more complex or more open strategy can be realized with contrib modules.
#7
fixed the test and fixed the patch
#8
#9
About patch of #7
Test with existing user OK.
Test with not existing gives the following error:
#10
fixed the warning from #9
fixed whitespaces
#11
Great stuff! but i do have 1 question:
Is it an idea to make this a configurable option? E.g. "B.S. mode" enabled? I had the same problem with a module i was working on to resend a user's name via e-email via a similiar way pass reset works. I ended up creating a config option that is enabled by default, so the admin has the choice. (because sometimes you just want to get the real info.)
Can (obviously) also start a new feature request / bug ones this issue is fixed. (I'll add it to my list of wanna-haves anyway, for when i have some time left. Thinking about making this a site wide option, used by multiple functions, registration / contact form can also make use use of it, if only for pranksters / bots.) And added it to the list of related on #1837054: [META] Refactor account workflow (and config)
#12
updating issue summary
#13
This seems like something we could do at any time and not something that would be subject to feature freeze, so moving to a bug. However, since it's simply a security hardening thing, I'm making it a normal bug.
#14
#15
making it configurable could be in the scope of this issue. I dont think we need a new feature request right away. lets see what we can do here.