#36179: hexed strings in common passwords database are not handled
-------------------------------------+-------------------------------------
Reporter: Michel Le Bihan | Owner: Michel Le
| Bihan
Type: Bug | Status: new
Component: contrib.auth | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
CommonPasswordValidator |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):
* stage: Unreviewed => Accepted
Comment:
Ah thank you!
Folks can de-hex using this tool:
https://www.rapidtables.com/convert/number/hex-to-ascii.html
Here is a regression test:
{{{#!diff
--- a/tests/auth_tests/test_validators.py
+++ b/tests/auth_tests/test_validators.py
@@ -273,6 +273,15 @@ class CommonPasswordValidatorTest(SimpleTestCase):
CommonPasswordValidator().validate("godzilla")
self.assertEqual(cm.exception.messages, [expected_error])
+ def test_common_hexed_codes(self):
+ expected_error = "This password is too common."
+ common_hexed_passwords = ["asdfjkl:", "ठ:"]
+ for password in common_hexed_passwords:
+ with self.subTest(password=password):
+ with self.assertRaises(ValidationError) as cm:
+ CommonPasswordValidator().validate(password)
+ self.assertEqual(cm.exception.messages, [expected_error])
+
def test_validate_custom_list(self):
path = os.path.join(
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/36179#comment:8>