9 vulnerabilities classified as CWE-759 (使用未加Salt的单向哈希算法). AI Chinese analysis included.
CWE-759 represents a cryptographic weakness where systems hash sensitive data, such as passwords, without incorporating a unique random value known as a salt. This omission significantly weakens security by allowing attackers to leverage pre-computed hash databases, commonly referred to as rainbow tables, to reverse-engineer original inputs. Without salt, identical passwords produce identical hashes, enabling efficient dictionary attacks that bypass the need for individual brute-force attempts per user. To mitigate this risk, developers must integrate a cryptographically secure, unique salt for every password before hashing. Modern best practices recommend using specialized key derivation functions like bcrypt, scrypt, or Argon2, which automatically handle salting and computational stretching, thereby ensuring that even compromised databases remain resistant to rapid decryption and mass credential exposure.
unsigned char *check_passwd(char *plaintext) { ctext = simple_digest("sha1",plaintext,strlen(plaintext), ... ); //Login if hash matches stored hash if (equal(ctext, secret_password())) { login_user(); } }String plainText = new String(plainTextIn); MessageDigest encer = MessageDigest.getInstance("SHA"); encer.update(plainTextIn); byte[] digest = password.digest(); //Login if hash matches stored hash if (equal(digest,secret_password())) { login_user(); }def storePassword(userName,Password): hasher = hashlib.new('md5') hasher.update(Password) hashedPassword = hasher.digest() # UpdateUserLogin returns True on success, False otherwise return updateUserLogin(userName,hashedPassword)def storePassword(userName,Password): hasher = hashlib.new('md5',b'SaltGoesHere') hasher.update(Password) hashedPassword = hasher.digest() # UpdateUserLogin returns True on success, False otherwise return updateUserLogin(userName,hashedPassword)Vulnerabilities classified as CWE-759 (使用未加Salt的单向哈希算法) represent 9 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.