Password strength requirements are enforced
Why it matters
Client-side password validation is trivially bypassed by calling the API directly with curl or any HTTP client. CWE-521 (Weak Password Requirements) is only exploitable when server-side enforcement is missing. NIST 800-63B §5.1.1.2 (Memorized Secret Verifiers) sets a minimum of 8 characters and specifically warns against composition rules; PCI-DSS Req-8.3.6 requires at least 12 characters. OWASP A07 lists weak password policies as an authentication failure. A single-character password accepted by your API means every user who sets a simple password has a credential that can be brute-forced in seconds from any leaked hash.
Severity rationale
Medium because weak password policy alone does not cause a breach, but it makes brute-force and credential stuffing attacks dramatically more effective when combined with any other failure.
Remediation
Enforce password requirements in the API route, not just the React component. Run validation before hashing so invalid passwords never touch the database:
function validatePassword(password: string): string | null {
if (password.length < 12) return 'Password must be at least 12 characters'
if (!/[A-Z]/.test(password)) return 'Must include an uppercase letter'
if (!/[0-9]/.test(password)) return 'Must include a number'
return null
}
export async function POST(request: Request) {
const { email, password } = await request.json()
const err = validatePassword(password)
if (err) return Response.json({ error: err }, { status: 400 })
// proceed to hash and create user
}
For Supabase Auth, configure minimum password length in the Supabase Dashboard under Auth > Settings > Password Requirements — Supabase enforces this server-side. Consider adding zxcvbn for entropy-based strength estimation alongside rule-based checks.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Authentication Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-521 — Weak Password Requirements
- owasp:2021 · A07
- nist:rev4 · SP-800-63B §5.1.1.2 — Memorized Secret Verifiers
- pci-dss:4.0 · Req 8.3.6
- soc2:2017 · CC6.1 — Logical access security software, infrastructure, and architectures
Taxons
History
- 2026-04-18·v1.0.0·Initial import from saas-authentication·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.1) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2