Problem/Motivation

Drupal 8 recommends to users, including the administration user when first created, that the password should be at least 6 characters long. This by most modern accounts is too short to be secure against any sort of brute force attack. Wikipedia suggests at least 12-14 which seems to be about the norm for suggestions of lengths of secure passwords.

Proposed resolution

Change the calculation of 'tooShort' to recommend at least 12 characters.

Remaining tasks

None apparent.

User interface changes

This changes the password suggestion string because the number in it is changed from 6 to 12.

API changes

None.

Comments

jbrauer’s picture

Patch to recommend that users use at least 12 characters which seems in most reading to be the low-end recommendation at this time.

jbrauer’s picture

Issue summary: View changes
Status: Active » Needs review
catch’s picture

This seems reasonable.

Also the numbers/mixed-case/punctuation we should make sure those disappear if the password is above a certain length as well. Obligatory link to xkcd.

alansaviolobo’s picture

StatusFileSize
new1.23 KB

reroll

Status: Needs review » Needs work

The last submitted patch, 4: user_module_should-2177769-4.patch, failed testing.

alansaviolobo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.23 KB

ended up exporting a reversed patch.

Status: Needs review » Needs work

The last submitted patch, 6: user_module_should-2177769-6.patch, failed testing.

Status: Needs work » Needs review
jbrauer’s picture

Status: Needs review » Needs work

Code comment also needs update.

jbrauer’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Update comment in patch as well.

greggles’s picture

This seems like a decent improvement.

I'll say that folks "serious" about the idea of an accurate password strength indicator would be well served to use https://www.drupal.org/project/password_strength

greggles’s picture

One more thought - the need for longer passwords, and how long is long enough is a site-specific question and it obviously changes over time. Rather than having this hard-coded, why not make it a variable? I don't think there needs to be an admin ui for it, but it could be in $conf in settings.php (or whatever the d8 equivalent is).

jbrauer’s picture

Very much agree with greggles in #12 ... this really should be a variable. I've not done that here in the hopes that a minimal patch had a better chance of getting in but if there's support for it think we really should have it as a variable.

Status: Needs review » Needs work

The last submitted patch, 10: user_module_should-2177769-10.patch, failed testing.

anavarre’s picture

Issue tags: +Needs reroll
anavarre’s picture

Issue tags: +Security improvements
anavarre’s picture

StatusFileSize
new1.68 KB

Straight reroll. Doesn't address #12.

anavarre’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 18: 2177769-18.patch, failed testing.

Status: Needs work » Needs review

anavarre queued 18: 2177769-18.patch for re-testing.

anavarre’s picture

Issue tags: -Needs reroll
am_sreenivasan’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new17.04 KB

Kudos to nice work done. The patch on 18th /2177769-18.patch is tested in multiple scenarios, browsers and following stages.

What worked:
1. Patch applied succesfully without errors.
2. Patch code seems legible and clean to good standard
3. Solution worked and solved to reflect postive results during password creation in the last screen of Drupal installation
It certainly checks and mandates a longer passwrod with minimum 12, checked for a mandatory combination of upper case, lowercase, numbers and punctuations

4. Solution also worked and solved to reflect postive results during change password screen for admin
It certainly checks and mandates a longer passwrod with minimum 12, checked for a mandatory combination of upper case, lowercase, numbers and punctuations

5. Solution also worked and solved to reflect postive results during password creation and also change password screen for new users
It certainly checks and mandates a longer passwrod with minimum 12, checked for a mandatory combination of upper case, lowercase, numbers and punctuations

Suggestion: The hint text given for password mismatch is currently as follows
Passwords match: yes
Passwords match: no

To keep this connsistent with the hint text given under first password field "Password strength: Weak", the "Yes" or "No" should start with capital letters. So to make it read as follows
Passwords match: Yes
Passwords match: No

greggles’s picture

@am_Sreenivasan - thanks for the review. I'd suggest making that upper/lower case problem a new issue. We should not sneak string changes into this issue as it could confuse translators.

ETA: not since the sentence was the opposite of what I meant.

anavarre’s picture

alexpott’s picture

Category: Feature request » Task
Status: Reviewed & tested by the community » Fixed

This seems a sensible security improvement to make. Changing a minimum value is not a feature request. Committed 767077f and pushed to 8.0.x. Thanks!

  • alexpott committed 767077f on 8.0.x
    Issue #2177769 by jbrauer, alansaviolobo, anavarre, am_Sreenivasan,...

Status: Fixed » Closed (fixed)

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