Password hashing uses bcrypt, argon2, or scrypt
Why it matters
Storing passwords with MD5, SHA-1, or unkeyed SHA-256 is a critical failure under CWE-916 and OWASP A02 (Cryptographic Failures). These algorithms are designed for speed, not password storage: an attacker who exfiltrates your database can crack billions of candidates per second on commodity hardware. A single database breach becomes a full credential compromise across every account. NIST 800-53 IA-5(1) mandates password-based authenticator storage use salted, one-way, adaptive hashing. Bcrypt, argon2id, or scrypt are the only acceptable choices because their cost factors are tunable to keep brute-force prohibitively expensive even as hardware improves.
Severity rationale
Critical because a plaintext or weakly-hashed password database converts a storage breach into an immediate account takeover for every user, with no time window to respond.
Remediation
Replace any non-adaptive hash with bcrypt (rounds ≥12) or argon2id in your auth library. For bcryptjs:
import bcrypt from 'bcryptjs'
const SALT_ROUNDS = 12
const hash = await bcrypt.hash(plainPassword, SALT_ROUNDS)
const valid = await bcrypt.compare(plainPassword, storedHash)
For new projects prefer argon2id per OWASP 2024: memoryCost: 65536, timeCost: 3. Migrate existing insecure hashes by re-hashing on next successful login and forcing a password reset for inactive accounts after 90 days.
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 Security Hardening Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-916 — Use of Password Hash With Insufficient Computational Effort
- owasp:2021 · A02 — Cryptographic Failures
- nist:rev5 · IA-5(1) — Authenticator Management: Password-Based Authentication
Taxons
History
- 2026-04-18·v1.0.0·Initial import from security-hardening·automated