SiteShadow
Back to vulnerability library

CWE-760 Predictable Salt in One-Way Hash

What this means

SiteShadow flagged a salt that appears static or predictable (hardcoded constant, reused across users, derived from usernames or timestamps). A salt needs to be unique and unpredictable per password hash.

Why it matters

Predictable salts reduce the effectiveness of hashing defenses.

Safer examples

1) Use a password hashing library that generates salts for you

import bcrypt from "bcryptjs";

const hash = await bcrypt.hash(password, 12); // salt generated internally

2) If you manage salts manually, generate random per-user salts

import secrets

salt = secrets.token_bytes(16)  # per password

3) Don't derive salts from user data

Avoid salts like salt = username or salt = created_at. Use randomness.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage