#36180: Consider adding repeated pattern password validator
---------------------------------+----------------------------------------
Reporter: Michel Le Bihan | Type: New feature
Status: new | Component: contrib.auth
Version: dev | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Hello,
Currently the password validators in Django will happily accept
`aaaaaaaaaaaa` ('a' * 12) as a password. I believe that adding a password
validator that checks for repeated patterns would vastly improve password
complexity. The implementation of such a validator is very simple:
{{{
import re
repeat_matcher = re.compile(r'(.+?)\1+')
match = repeat_matcher.match(password)
repeat_cnt = len(match.group(0)) // len(match.group(1)) - 1 if match else
0
}}}
`repeat_cnt` for `alaalaala` should be 2.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36180>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.