Usage of weak hashing library on a password (MD5)

Description

Using a weak hashing library like MD5 for password storage compromises security. MD5 is outdated and vulnerable, making it easier for attackers to crack passwords and gain unauthorized access.

Remediations

  • Do not use MD5 or similar weak hashing algorithms for password storage. These methods are no longer secure and significantly increase the risk of your data being compromised.
  • Do use strong, recommended hashing libraries such as bcrypt or Argon2id for storing passwords. These libraries provide a higher level of security and are designed to protect against common attack vectors.
    BCrypt::Password.create("password_123")
    hasher = Argon2::Password.new()
    hasher.create("password_123")

References

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=ruby_lang_weak_password_hash_md

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=ruby_lang_weak_password_hash_md