question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simple improvements to password validation

See original GitHub issue

We previously tried to implement a “password strength indicator” into Ghost (ref #5309), but got stuck on the libraries being too big. However, in abandoning strength indication, we’ve totally missed out on adding very simple rules to prevent the most obvious and heinous of password mistakes.

We want to both increase the minimum length for passwords, and add a couple of very simple rules.

The most important thing about these new validation rules, is that they MUST not interfere with existing users being able to login or save their profile. The new validation rules must also not prevent old blog content from being imported. They should ensure that a user creating an account, or changing a password, get validated more strongly.

The first 3 tasks go together, to cover making a single change to these rules and then ensuring that it doesn’t impact anything it shouldn’t. Once that is done, each of the following rules can be added one-by-one.

Increase minimum length:

  • Increase password minimum from 8 to 10 characters (ensure it is messaged properly)
  • Testing to ensure this does not impact on saving user profiles, imports or any other user-based action where the password is not being changed.
  • Improve importer logic, see notes below

Add simple rules:

  • Design note: adding rules will require a new validation error message, this will need to be run past @JohnONolan
  • Disallow obviously bad passwords: 1234567890, qwertyuiop, asdfghjkl; and abcdefghij.
  • Disallow passwords that contain the words “password” or “ghost”
  • Disallow passwords that match the user’s email address
  • Disallow passwords that match the blog domain
  • Add a very simple entropy measure with a cut off e.g. if 50% or more of characters are the same - this prevents ‘aaaaaaaaaa’ and ‘ababababab’ style passwords.

Advanced changes (these are for a new issue, later):

  • Research an advanced entropy measure, with a score system
  • Maybe add a larger library, but using lazy loading (this is now possible)
  • Add a signal strength indicator to the UI

Ref material: https://blog.codinghorror.com/password-rules-are-bullshit/

Notes on Import rules:

At the moment, our import rules for passwords are a bit weird. There are 2 modes:

  1. “importPersistUser” mode, is a special mode in which users should be persisted exactly as they were. No validations should be run.
  2. “normal” mode, in which we expect to be importing a JSON file which is an original export, but it may also be user generated. Here, validations should run but the outcome is slightly different…

Validating the field should be a case of: Check if the contents of the field is a hash:

  • If it is a hash, don’t need to validate, re-hash-the-hash, store that.
  • If it is not a hash, all the normal password validation rules should be run, then hash.

@kirrg001 can you confirm this logic please?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
ermyrilcommented, Jul 19, 2020

Hello!

Sorry for bumping an old issue, it’s more like a feature request, but please add more descriptive validation errors. It’s definitely not obvious what’s wrong when an application just tells you “Sorry, you cannot use an insecure password” when you’re just typed something like “GhostinglyCrypticGibberish8*5%”

1reaction
JohnONolancommented, May 7, 2021

Sorry for the ambiguous error message! Usually shows up if you’re using “ghost” as part of the password - which I agree is confusing. We’ll update

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Customize Password Validation | Curity Identity Server
Learn how to validate passwords in the backend and override the existing progress bar in the frontend.
Read more >
Password Creation: 3 Ways To Make It Easier
Ease password creation by showing users the text they type, the password requirements, and a password-strength meter.
Read more >
Password Validation using regular expressions and HTML5
Examples of form validation using both simple and complex regular expressions. Restricting to alphanumeric and letter characters.
Read more >
Password Best Practices for Today - Pluralsight
Updated Password Best Practices · Variation of Alphanumeric Characters · 8-10 Characters Long · Forced Regular Password Changes · Password Hints · No...
Read more >
NIST Password Guidelines and Best Practices for 2020 - Auth0
The NIST Password Guidelines (AKA NIST Special Publication 800-63B) are considered the most influential standards for password security.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found