Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2018-16395
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 06:09 UTC · Revision 1
Source evidence
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.
osv:CVE-2018-16395
Complete source record
{
"id": "0ffd7e83ec8c3d20f266e7c953e3db2aba47677a1c058a41e3f8b16577aa9dd6",
"url": "https://osv.dev/vulnerability/CVE-2018-16395",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2018-16395",
"summary": "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.",
"evidence": "osv:CVE-2018-16395",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2018-16395",
"aliases": [
"CVE-2018-16395",
"GHSA-mmrq-6999-72v8"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/ruby/openssl",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "08e12dd9302c1fd517c642bdd7d274e64b354c53"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:ruby-lang:openssl:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "2.1.2"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v2.1.1",
"v2.1.0",
"v2.1.0.beta2",
"v2.1.0.beta1",
"v2.0.2",
"v2.0.1",
"v2.0.0",
"v2.0.0.beta.2",
"v2.0.0.beta.1"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-16395.json"
}
},
{
"ranges": [
{
"repo": "https://github.com/ruby/ruby",
"type": "GIT",
"events": [
{
"introduced": "d40ea2afa6ff5a6e5befcf342fb7b6dc58796b20"
},
{
"last_affected": "9bfe7fc5cb457c7bc8df96115ee70b9035f5d885"
},
{
"introduced": "d4bb726b713658f56e630b6cf817a0155b6f390e"
},
{
"last_affected": "a8197e08f58c5f2e6d32a774866e0e0d58749911"
},
{
"introduced": "4e0a512972cdcbfcd5279f1a2a81ba342ed75b6e"
},
{
"last_affected": "85883dc393f60adc3043d28899eff3f1ce53b4a5"
},
{
"introduced": "ce0e3fc1b10d1f5c5ad6bc31ba344904345468a2"
},
{
"last_affected": "6f59db30c18cd793cbf6169301158493df7e78e4"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.3.0"
},
{
"last_affected": "2.3.7"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.4.0"
},
{
"last_affected": "2.4.4"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.5.0"
},
{
"last_affected": "2.5.1"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:ruby-lang:ruby:2.6.0:preview1:*:*:*:*:*:*",
"range": [
{
"introduced": "2.6.0-preview1"
},
{
"last_affected": "2.6.0-preview1"
}
],
"source": "CPE_STRING"
},
{
"cpe": "cpe:2.3:a:ruby-lang:ruby:2.6.0:preview2:*:*:*:*:*:*",
"range": [
{
"introduced": "2.6.0-preview2"
},
{
"last_affected": "2.6.0-preview2"
}
],
"source": "CPE_STRING"
}
]
}
}
],
"versions": [
"2.6.0-preview1",
"2.6.0-preview2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-16395.json"
}
}
],
"modified": "2026-10-24T10:30:35.893506376Z",
"provider": "osv",
"references": [
"https://www.oracle.com/security-alerts/cpujan2020.html",
"https://access.redhat.com/errata/RHSA-2018:3729",
"https://access.redhat.com/errata/RHSA-2018:3730",
"https://access.redhat.com/errata/RHSA-2018:3731",
"https://access.redhat.com/errata/RHSA-2018:3738",
"https://access.redhat.com/errata/RHSA-2019:1948",
"https://access.redhat.com/errata/RHSA-2019:2565",
"https://lists.debian.org/debian-lts-announce/2018/10/msg00020.html",
"https://security.netapp.com/advisory/ntap-20190221-0002/",
"https://usn.ubuntu.com/3808-1/",
"https://www.debian.org/security/2018/dsa-4332",
"https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/",
"https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-3-8-released/",
"https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-4-5-released/",
"https://www.ruby-lang.org/en/news/2018/10/17/ruby-2-5-2-released/",
"https://www.ruby-lang.org/en/news/2018/11/06/ruby-2-6-0-preview3-released/",
"https://hackerone.com/reports/387250"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:*",
"cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*",
"cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*",
"cpe:2.3:o:canonical:ubuntu_linux:18.10:*:*:*:*:*:*:*"
],
"vendor_product": "canonical:ubuntu_linux",
"extracted_events": [
{
"range": [
{
"introduced": "14.04"
},
{
"last_affected": "14.04"
},
{
"introduced": "16.04"
},
{
"last_affected": "16.04"
},
{
"introduced": "18.04"
},
{
"last_affected": "18.04"
},
{
"introduced": "18.10"
},
{
"last_affected": "18.10"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*",
"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
],
"vendor_product": "debian:debian_linux",
"extracted_events": [
{
"range": [
{
"introduced": "8.0"
},
{
"last_affected": "8.0"
},
{
"introduced": "9.0"
},
{
"last_affected": "9.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:o:redhat:enterprise_linux:7.4:*:*:*:*:*:*:*"
],
"vendor_product": "redhat:enterprise_linux",
"extracted_events": [
{
"range": [
{
"introduced": "7.4"
},
{
"last_affected": "7.4"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2018-16395",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 433859,
"published_at": "2018-11-16T18:29:00.943+00:00"
}