Insecure Encryption Affecting aes package, versions >= 0


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

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 Learn

Learn about Insecure Encryption vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-AES-20286
  • published7 Feb 2017
  • disclosed24 Sept 2014
  • creditKacper Walanus

Introduced: 24 Sep 2014

CVE NOT AVAILABLE CWE-327  (opens in a new tab)

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.

CVSS Scores

version 3.1