Repository navigation
[INFRA-1157] fix(security): bound password input scored by zxcvbn - #10043
Conversation
Add is_password_strong() helper that scores only the first 128 characters, and route every zxcvbn caller (sign-up, password set/change/reset, instance admin sign-up, reset_password command) through it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Score the first and the last ZXCVBN_MAX_LENGTH characters and accept the password if either window is strong; add a unit test that only the password helper imports zxcvbn. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lovelace3
left a comment
There was a problem hiding this comment.
No blocking findings.
Verified:
test_password_strength_input_bound_app.pyandunit/utils/test_zxcvbn_imports.py: 5 passed.test_authentication.pyandsmoke/test_auth_smoke.py: 36 passed.- Falsification: with the six callers reverted to the merge-base (helper kept), both
test_sign_up_scores_bounded_password_windowscases and the import guard fail. With the helper changed to score the prefix only,test_sign_up_accepts_long_password_with_strong_tailfails. - Cost is bounded. Local zxcvbn timings: 128 chars took 30–62 ms across repeated, digit, dictionary, date and random inputs, against 9–40 s at 1000 chars.
is_password_strong()on 100k-character inputs of each shape took 30–58 ms. - Coverage: the import-guard test is what keeps the reset, change/set-password, instance admin sign-up and
reset_passwordpaths behind the helper, because only sign-up is exercised end to end. That's adequate since every path calls the same function. The full password is still hashed, andcheck_passwordagainst the 320-character value passes.
…0043) * [INFRA-1157] fix(security): bound password input scored by zxcvbn Add is_password_strong() helper that scores only the first 128 characters, and route every zxcvbn caller (sign-up, password set/change/reset, instance admin sign-up, reset_password command) through it. * [INFRA-1157] fix: address review Score the first and the last ZXCVBN_MAX_LENGTH characters and accept the password if either window is strong; add a unit test that only the password helper imports zxcvbn.
Description
Password strength checks passed the full submitted password to
zxcvbn, with no length bound.is_password_strong()inplane/authentication/utils/password.pyscores the first and the last 128 characters (ZXCVBN_MAX_LENGTH) and treats the password as strong if either window hasscore >= 3, the threshold every caller already used.zxcvbncaller now goes through it:Adapter.validate_password(app and space sign-up), change/set password (views/common.py), app and space password reset, instance admin sign-up, and thereset_passwordmanagement command.plane/other than this helper importszxcvbn.Behaviour change: none for passwords up to 128 characters. Longer passwords are judged on their first and last 128 characters and accepted if either is strong. The UI has no maximum length, so nothing is rejected for length.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
"password" * 16 + "Xk9#mQ2$vL7@pR4!"(weak start, strong end): accepted.password): still rejected withPASSWORD_TOO_WEAK.plane/tests/contract/app/test_password_strength_input_bound_app.py,test_authentication.py,smoke/test_auth_smoke.py: 39 passed. The new bound test fails without the fix (assert 320 <= 128).unit/utils/test_zxcvbn_imports.pypass (5); the strong-tail case fails with prefix-only scoring.References
🤖 Generated with Claude Code
Summary by CodeRabbit