Insecure Encryption Affecting aes package, versions >= 0
Snyk CVSS
Attack Complexity
Low
Confidentiality
High
Integrity
High
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-RUBY-AES-20286
- published 7 Feb 2017
- disclosed 24 Sep 2014
- credit Kacper Walanus
How to fix?
As of Jan. 18th there is still no fixed version, but a PR was created.
Overview
aes
is an AES encrypt/decrypt gem built on top of OpenSSL.
Affected versions of this gem do not properly encrypt messages due to using the ruby hex
function. hex
converts hexadecimal strings into an integer and if it fails, zero is returned.
'10'.hex #=> 16
'ff'.hex #=> 255
# zero is returned on error:
'foobar'.hex #=> 0
Any string that doesn't have a hexadecimal sequence (e.g. ff
or 13
) will be transformed into an array of 32 zeros, making it possible to decrypt messages with almost any key.