CVE-2018-16395: Critical severity ruby-lang Openssl Ruby vulnerability

Published Oct 25, 2018
·
Updated

An instance of OpenSSL::X509::Name contains entities such as CN, C and so on. Some two instances of OpenSSL::X509::Name are equal only when all entities are exactly equal. However, there is a bug that the equality check is not correct if the value of an entity of the argument (right-hand side) starts with the value of the receiver (left-hand side). So, if a malicious X.509 certificate is passed to compare with an existing certificate, there is a possibility to be judged incorrectly that they are equal.

External References:

https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/

Other sources

An issue was discovered in the OpenSSL library in Ruby before 2.3.8, 2.4.x before 2.4.5, 2.5.x before 2.5.2, and 2.6.x before 2.6.0-preview3. When two OpenSSL::X509::Name objects are compared using ==, depending on the ordering, non-equal objects may return true. When the first argument is one character longer than the second, or the second argument contains a character that is one less than a character in the same position of the first argument, the result of == will be true. This could be leveraged to create an illegitimate certificate that may be accepted as legitimate and then used in signing or encryption operations.

Launchpad

An issue was discovered in the OpenSSL library in Ruby when two OpenSSL::X509::Name objects are compared using ==, depending on the ordering, non-equal objects may return true. When the first argument is one character longer than the second, or the second argument contains a character that is one less than a character in the same position of the first argument, the result of == will be true. This could be leveraged to create an illegitimate certificate that may be accepted as legitimate and then used in signing or encryption operations.

Affected Software

18 affected componentsFixes available
rubygems/openssl>=2.1.0<2.1.2
2.1.2
rubygems/openssl<2.0.9
2.0.9
debian/ruby-openssl
debian/ruby2.1
debian/ruby2.5
ruby-lang Openssl Ruby<2.1.2
ruby-lang Ruby>=2.3.0<=2.3.7
ruby-lang Ruby>=2.4.0<=2.4.4
ruby-lang Ruby>=2.5.0<=2.5.1
ruby-lang Ruby=2.6.0-preview1
ruby-lang Ruby=2.6.0-preview2
Canonical Ubuntu Linux=14.04
Canonical Ubuntu Linux=16.04
Canonical Ubuntu Linux=18.04
Canonical Ubuntu Linux=18.10
Debian Debian Linux=8.0
Debian Debian Linux=9.0
redhat Enterprise Linux=7.4

Remediation

Event History

Oct 25, 2018
Data Sourced
via Red Hat·01:35 PM
DescriptionSeverityAffected Software
Nov 16, 2018
CVE Published
via MITRE·06:00 PM
Data Sourced
via MITRE·06:00 PM
Description
Data Sourced
via NVD·06:29 PM
RemedyDescriptionSeverityAffected Software
May 13, 2022
Advisory Published
01:50 AM
Jan 11, 2024
Data Sourced
via Launchpad·10:53 PM
Description
Feb 20, 2026
Data Sourced
via Ubuntu·05:36 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is CVE-2018-16395?

CVE-2018-16395 is a vulnerability in the OpenSSL library in Ruby that allows non-equal objects to return true when compared using certain conditions.

2

What is the severity of CVE-2018-16395?

CVE-2018-16395 has a severity rating of 9.8, which is considered critical.

3

Which software versions are affected by CVE-2018-16395?

CVE-2018-16395 affects Ruby versions before 2.3.8, 2.4.x before 2.4.5, 2.5.x before 2.5.2, and 2.6.x before 2.6.0-preview3.

4

How can I fix CVE-2018-16395?

To fix CVE-2018-16395, update your Ruby installation to version 2.3.8 or later.

5

Where can I find more information about CVE-2018-16395?

You can find more information about CVE-2018-16395 in the references provided: [Debian LTS announce](https://lists.debian.org/debian-lts-announce/2018/10/msg00020.html), [HackerOne report](https://hackerone.com/reports/387250), [Ruby-lang.org news](https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203