Skip to content

Secrets & keys

Passwords hashed with a fast hash (MD5/SHA)secrets.weak-password-hash

MD5 and SHA-1/SHA-256 are built to be fast, so a leaked password table can be cracked at billions of guesses per second on one GPU. Most user passwords would fall within hours. Passwords need a slow, salted password hash.

  • In force Rule secrets.weak-password-hash
  • 3 clauses

At a glance

secrets.weak-password-hash
Severityhigh
CertaintyObserved — the code as written is the problem
Looks atyour source code
When it runsRuns on every scan

How to fix it

Use bcrypt, scrypt or Argon2: `const hash = await bcrypt.hash(password, 12)` to store and `await bcrypt.compare(password, hash)` to check. Re-hash existing users on their next successful login.

Check your own app

Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.

If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line secrets.weak-password-hash -- <why>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.