Weak hashing library (SHA-1) detected
- Rule ID: java_lang_weak_password_hash_sha1
- Languages: java
- Source: weak_password_hash_sha1.yml
Description
A weak hashing library can lead to data breaches and greater security risk.
Remediations
According to OWASP, SHA1 is considered a weak hashing algorithms and therefore shouldn't be used.
❌ Avoid libraries and algorithms with known weaknesses:
MessageDigest md = MessageDigest.getInstance("SHA-1");
✅ Use stronger encryption algorithms when storing data.
MessageDigest md = MessageDigest.getInstance("SHA-256");
Resources
Associated CWE
- CWE-327: Use of a Broken or Risky Cryptographic Algorithm
- CWE-916: Use of Password Hash With Insufficient Computational Effort
OWASP Top 10
Configuration
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=java_lang_weak_password_hash_sha1
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=java_lang_weak_password_hash_sha1
Ready to take the next step? Learn more about Bearer Cloud.