security: reject common/weak passwords on every set-password path (#31) #60

Open
Hartmut wants to merge 2 commits from security/password-policy-blacklist into main

2 Commits

Author SHA1 Message Date
Hartmut cfce1f2a15 test(shared): narrow PasswordCheckResult before reading reason
CI / Architecture Guardrails (pull_request) Successful in 6m11s
CI / Assistant Split Regression (pull_request) Successful in 7m19s
CI / Lint (pull_request) Successful in 7m59s
CI / Typecheck (pull_request) Successful in 9m28s
CI / Build (pull_request) Successful in 6m53s
CI / E2E Tests (pull_request) Successful in 6m7s
CI / Fresh-Linux Docker Deploy (pull_request) Successful in 6m52s
CI / Release Images (pull_request) Has been skipped
CI / Unit Tests (pull_request) Successful in 8m30s
CI 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>
2026-04-18 14:53:30 +02:00
Hartmut e01074926e security: reject common/weak passwords on every set-password path (#31)
CI / Architecture Guardrails (pull_request) Successful in 6m31s
CI / Typecheck (pull_request) Failing after 6m9s
CI / Build (pull_request) Has been skipped
CI / E2E Tests (pull_request) Has been skipped
CI / Fresh-Linux Docker Deploy (pull_request) Has been skipped
CI / Assistant Split Regression (pull_request) Successful in 7m23s
CI / Lint (pull_request) Successful in 6m54s
CI / Unit Tests (pull_request) Successful in 9m28s
CI / Release Images (pull_request) Has been skipped
Adds a synchronous policy check that blocks (1) the curated >=12-char
common-password list (rockyou top, predictable seasonal, admin defaults),
(2) trivial patterns (single-char repeat, short-pattern repeat, keyboard
or numeric sequences), and (3) passwords containing the user's email
local-part or any name component. Wired into all five password-mutation
sites: first-admin setup, admin createUser/setUserPassword, invite
acceptance, and password-reset.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 14:09:38 +02:00