Cryptographic Failures
Sensitive data is not encrypted, or is protected with weak crypto.
What it is
Passwords, tokens and personal data need the right protection: TLS on the wire, slow salted hashes for passwords, and strong random values for tokens. Old algorithms (MD5, SHA-1) or home-made crypto give a false sense of safety.
What can happen
- Leaked password hashes are cracked in minutes.
- Data sent over plain HTTP is read on public Wi-Fi.
- Predictable reset tokens let attackers take over accounts.
Example: Storing passwords
import { createHash } from "node:crypto";
// Fast hash, no salt: same password -> same hash, cracked by lookup tables.
const hash = createHash("md5").update(password).digest("hex");import bcrypt from "bcrypt";
// Slow, salted, with a cost factor you can raise later.
const hash: string = await bcrypt.hash(password, 12);
const ok: boolean = await bcrypt.compare(attempt, hash);For tokens (email verify, password reset) use crypto.randomBytes(32), and store only its SHA-256 hash.
How to prevent it
- HTTPS everywhere, with HSTS. Cookies marked Secure.
- Passwords: bcrypt, scrypt or argon2. Never MD5 or SHA-1.
- Tokens from crypto.randomBytes, never Math.random.
- Don't store sensitive data you don't need.
What CrimsonScan checks
Partly detectedThe light scan checks TLS (old protocols, weak ciphers, expired certificates). The heavy scan flags cookies without Secure. How passwords are stored is invisible from outside.