CVE-2018-16395
CRITICAL 9.8CVSS 3.0Ruby Openssl Allows Incorrect Value Comparison
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.
- Published
- 16 Nov 2018
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Also known as
- GHSA-mmrq-6999-72v8
- Sources
- NVDJSONOSV GHSA-mmrq-6999-72v8JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.0 | CRITICAL 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.0 | CRITICAL 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | HIGH 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | ruby-lang | opensslcpe:2.3:a:ruby-lang:openssl:*:*:*:*:*:ruby:*:* |
< 2.1.2 | 2.1.2 |
| NVD | ruby-lang | rubycpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:* |
>= 2.3.0, <= 2.3.7 | |
| NVD | ruby-lang | rubycpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:* |
>= 2.4.0, <= 2.4.4 | |
| NVD | ruby-lang | rubycpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:* |
>= 2.5.0, <= 2.5.1 | |
| NVD | ruby-lang | rubycpe:2.3:a:ruby-lang:ruby:2.6.0:preview1:*:*:*:*:*:* |
= 2.6.0 | |
| NVD | ruby-lang | rubycpe:2.3:a:ruby-lang:ruby:2.6.0:preview2:*:*:*:*:*:* |
= 2.6.0 | |
| NVD | canonical | ubuntu_linuxcpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:* |
= 14.04 | |
| NVD | canonical | ubuntu_linuxcpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:* |
= 16.04 | |
| NVD | canonical | ubuntu_linuxcpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:* |
= 18.04 | |
| NVD | canonical | ubuntu_linuxcpe:2.3:o:canonical:ubuntu_linux:18.10:*:*:*:*:*:*:* |
= 18.10 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:* |
= 8.0 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* |
= 9.0 | |
| NVD | redhat | enterprise_linuxcpe:2.3:o:redhat:enterprise_linux:7.4:*:*:*:*:*:*:* |
= 7.4 | |
| OSV | RubyGems | openssl | < 2.0.9 | 2.0.9 |
| OSV | RubyGems | openssl | >= 2.1.0, < 2.1.2 | 2.1.2 |
References
- http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.html · Mailing List, Third Party Advisory, WEB
- http://www.securitytracker.com/id/1042105 · Third Party Advisory, VDB Entry
- https://access.redhat.com/errata/RHSA-2018:3729 · Third Party Advisory, WEB
- https://access.redhat.com/errata/RHSA-2018:3730 · Third Party Advisory, WEB
- https://access.redhat.com/errata/RHSA-2018:3731 · Third Party Advisory, WEB
- https://access.redhat.com/errata/RHSA-2018:3738 · Third Party Advisory, WEB
- https://access.redhat.com/errata/RHSA-2019:1948 · Third Party Advisory, WEB
- https://access.redhat.com/errata/RHSA-2019:2565 · WEB
- https://hackerone.com/reports/387250 · Patch, Third Party Advisory, WEB
- https://lists.debian.org/debian-lts-announce/2018/10/msg00020.html · Third Party Advisory, WEB
- https://security.netapp.com/advisory/ntap-20190221-0002/ · Third Party Advisory, WEB
- https://usn.ubuntu.com/3808-1/ · Third Party Advisory, WEB
- https://www.debian.org/security/2018/dsa-4332 · Third Party Advisory, WEB
- https://www.oracle.com/security-alerts/cpujan2020.html · WEB
- https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/ · Mitigation, Vendor Advisory, WEB
- https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-3-8-released/ · Release Notes, Vendor Advisory, WEB
- https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-4-5-released/ · Release Notes, Vendor Advisory, WEB
- https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-5-2-released/ · Release Notes, Vendor Advisory, WEB
- https://www.ruby-lang.org/en/news/2018/11/06/ruby-2-6-0-preview3-released/ · Release Notes, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2018-16395 · ADVISORY
- https://github.com/ruby/openssl/commit/f653cfa43f0f20e8c440122ea982382b6228e7f5 · WEB
- https://web.archive.org/web/20211206015239/https://securitytracker.com/id/1042105 · WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/openssl/CVE-2018-16395.yml · WEB
History
- 25 Nov 2026 20:21 UTC · NVD: first stored (published 16 Nov 2018)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 13 May 2022)