security: reject common/weak passwords on every set-password path (#31) #60
Reference in New Issue
Block a user
Delete Branch "security/password-policy-blacklist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
checkPasswordPolicy()in@capakraken/sharedthat rejects common-list, trivial-pattern, sequential, and identity-containing passwordsWhat this blocks
>=12-char dictionary entries that would pass the length gate (rockyou top, predictable seasonal/admin-default patterns)aaaaaaaaaaaa,abcabcabcabc, keyboard runs likeabcdefghijklWhy
CDP epic #1 — addresses the open
\ud83d\udd34 Block commonly chosen passwordsitem in #31. Active password-expiry tracking (passwordChangedAton theUsermodel + admin-configurable max age) is intentionally out of scope here and will land as a follow-up so this PR stays additive and migration-free.Test plan
pnpm --filter @capakraken/shared exec vitest run(279 pass, +17 new)pnpm --filter @capakraken/api exec vitest run(1945 pass)pnpm --filter @capakraken/web exec vitest run(1285 pass)pnpm --filter @capakraken/{web,api,shared} exec tsc --noEmitcleanpnpm lintclean (0 errors)9ef7114c77toe01074926eCI typecheck failed because the discriminated union returned by checkPasswordPolicy only exposes `reason` on the `{ ok: false }` branch. Guard each `.reason` assertion with `if (!result.ok)` so the test file typechecks under exactOptionalPropertyTypes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.