Why it matters
These are broken or leak the structure of the data.
How to fix it
Use OpenSSL::Cipher.new("aes-256-gcm") with a random IV, or ActiveSupport::MessageEncryptor.
Example
The rule's own test fixtures, verbatim: the test suite requires the rule to report the first and not the second.
def encryptor
OpenSSL::Cipher.new("des-ede3-cbc").encrypt
enddef encryptor
OpenSSL::Cipher.new("aes-256-gcm").encrypt
endWhat TrustIvan reads
Runs on repository scans of Ruby source once static analysis is turned on (SAST_RULES and the separately built analyzer image); it is off by default.
Weakness classes and references
Related checks
- Weak hash (Ruby)
RubySeverity: Medium
trustivan-ruby-weak-hash - Insecure random secret (Ruby)
RubySeverity: Medium
trustivan-ruby-insecure-random-secret - CSRF protection disabled (Ruby)
RubySeverity: Medium
trustivan-ruby-csrf-protection-disabled - TLS verification disabled (Ruby)
RubySeverity: High
trustivan-ruby-tls-verification-disabled - Mass assignment permit all (Ruby)
RubySeverity: High
trustivan-ruby-mass-assignment-permit-all - Marshal load (Ruby)
RubySeverity: Medium
trustivan-ruby-marshal-load
Terms: SAST (static application security testing), Taint analysis, CWE (Common Weakness Enumeration), OWASP Top 10
All static analysis (SAST) checks · The whole catalogue · How this works in TrustIvan · Documentation