Usage of weak hashing library (SHA)
- Rule ID: ruby_lang_weak_hash_sha
- Languages: ruby
- Source: weak_hash_sha.yml
A weak hashing library can lead to data breaches and greater security risk.
According to OWASP, SHA and SHA1 are considered weak hash algorithms and therefore shouldn't be used.
❌ Avoid libraries and algorithms with known weaknesses:
Digest::SHA.hexdigest 'weak hash'
Digest::SHA1.hexdigest 'weak hash'
✅ Instead, we recommend using bcrypt:
OWASP Top 10
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=ruby_lang_weak_hash_sha
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=ruby_lang_weak_hash_sha
Ready to take the next step? Learn more about Bearer Cloud.