Page MenuHomePhabricator

Length switches for CreateCommonPasswordCdb.php
Open, MediumPublicFeature

Description

Summary

PHP maintenance script createCommonPasswordCdb.php could support generating a list of common passwords of a minimum and/or maximum length.

Detail

On our wiki, the password policy requires passwords to be at least ten characters for all users, and not one of the 100,000 commonly used passwords on the internet. It is similar to Wikimedia’s password policy (source).

We use the CreateCommonPasswordCdb.php script to create a database of the 100,000 commonly used passwords from a list of a million passwords, but I noticed that the output contain many passwords of less than 10 characters (including the dreaded “password”), which are already blocked anyway by our password length requirements. This kind of duplication, in my opinion, weakens the effectiveness in blocking common passwords.

Therefore I would like to suggest adding two optional parameters.

Example inputs

To create a CDB file contains 100,000 common passwords of 10 characters or more, type:

php createCommonPasswordCdb.php --limit 100000 --min-length 10 ...

To create a CDB file contains 50,000 common passwords of up to 20 characters, type:

php createCommonPasswordCdb.php --limit 50000 --max-length 20 ...

To create a CDB file contains 25,000 common passwords of 15 to 30 characters, type:

php createCommonPasswordCdb.php --limit 25000 --min-length 15 --max-length 30 ...

The “help” description could state the following (in the Script specific parameters section):

--min-length: Minimum length of passwords to write
--max-length: Maximum length of passwords to write

Hopefully, I got this suggestion right.

Event Timeline

Marianian triaged this task as Medium priority.