Usage of weak encryption algorithm (Blowfish)
- Rule ID: ruby_lang_weak_encryption_blowfish
- Languages: ruby
- Source: weak_encryption_blowfish.yml
Description
Using Blowfish for encryption is a security risk as it is a weak algorithm, vulnerable to collision attacks (including birthday attacks) where two different inputs can produce the same hash value, compromising data integrity and security. A weak encryption library can lead to data breaches and greater security risk.
Remediations
- Do not use Blowfish as it is considered a weak encryption algorithm. This can make your data vulnerable to attacks.
Crypt::Blowfish.new("weak password encryption") #unsafe
- Do use stronger encryption algorithms like bcrypt to ensure higher security levels for your data.
BCrypt::Password.create('iLOVEdogs123')
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_encryption_blowfish
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=ruby_lang_weak_encryption_blowfish