HIGH AI PREVALENCE: HIGH auth.flow.weak-password-hash
A password is being hashed with a fast, general-purpose hash (MD5/SHA-1/SHA-256/SHA-512 via crypto.createHash).
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
These functions are designed to be FAST, so an attacker who steals the database can brute-force billions of candidate passwords per second on commodity GPUs. Salting alone does not fix this.
Use a dedicated, deliberately-slow password hashing function instead: bcrypt, argon2 (argon2id), or scrypt (crypto.scrypt). These add a tunable work factor that makes large-scale brute-forcing infeasible.
VULNERABLE
SAFE
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.flow.weak-password-hash -- <reason>