This vulnerability occurs when a system uses a one-way hash function (like MD5 or SHA-256) to protect sensitive data like passwords, but fails to add a unique random value called a salt before hashing.
Without a salt, identical passwords produce identical hash values. This allows attackers to use pre-computed tables of common password hashes, known as rainbow tables, to quickly reverse the hash and discover the original password. Salting ensures every hash is unique, even for identical passwords, rendering these pre-computed attacks ineffective. However, it's important to understand that salting alone is not a complete defense against determined attackers with significant resources, like cloud computing or specialized hardware. While it prevents rainbow table attacks, it doesn't significantly slow down targeted brute-force or dictionary attacks if the underlying hash function is fast to compute. For true password security, a salt must be combined with intentionally slow, adaptive hash functions designed for password storage (like bcrypt, scrypt, or Argon2), as detailed in CWE-916.
Impact: Bypass Protection MechanismGain Privileges or Assume Identity
If an attacker can gain access to the hashes, then the lack of a salt makes it easier to conduct brute force attacks using techniques such as rainbow tables.
Effectiveness: High
Effectiveness: Limited
c
//Login if hash matches stored hash* if (equal(ctext, secret_password())) { ``` login_user(); } }
java
//Login if hash matches stored hash* if (equal(digest,secret_password())) { ``` login_user(); }
python
pythonpython
python