ID 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.
References
Vulnerable Configurations
  • Ruby-lang Ruby 2.3.0
    cpe:2.3:a:ruby-lang:ruby:2.3.0
  • Ruby-lang Ruby 2.3.0 Preview 1
    cpe:2.3:a:ruby-lang:ruby:2.3.0:preview1
  • Ruby-lang Ruby 2.3.0 Preview 2
    cpe:2.3:a:ruby-lang:ruby:2.3.0:preview2
  • Ruby-lang Ruby 2.3.1
    cpe:2.3:a:ruby-lang:ruby:2.3.1
  • Ruby-lang Ruby 2.3.2
    cpe:2.3:a:ruby-lang:ruby:2.3.2
  • Ruby-lang Ruby 2.3.3
    cpe:2.3:a:ruby-lang:ruby:2.3.3
  • Ruby-lang Ruby 2.3.4
    cpe:2.3:a:ruby-lang:ruby:2.3.4
  • Ruby-lang Ruby 2.3.5
    cpe:2.3:a:ruby-lang:ruby:2.3.5
  • Ruby-lang Ruby 2.3.6
    cpe:2.3:a:ruby-lang:ruby:2.3.6
  • Ruby-lang Ruby 2.3.7
    cpe:2.3:a:ruby-lang:ruby:2.3.7
  • Ruby-lang Ruby 2.4.0
    cpe:2.3:a:ruby-lang:ruby:2.4.0
  • Ruby-lang Ruby 2.4.0 Preview 1
    cpe:2.3:a:ruby-lang:ruby:2.4.0:preview1
  • Ruby-lang Ruby 2.4.0 Preview 2
    cpe:2.3:a:ruby-lang:ruby:2.4.0:preview2
  • Ruby-lang Ruby 2.4.0 Preview 3
    cpe:2.3:a:ruby-lang:ruby:2.4.0:preview3
  • Ruby-lang Ruby 2.4.0 Release Candidate 1
    cpe:2.3:a:ruby-lang:ruby:2.4.0:rc1
  • Ruby-lang Ruby 2.4.1
    cpe:2.3:a:ruby-lang:ruby:2.4.1
  • Ruby-lang Ruby 2.4.2
    cpe:2.3:a:ruby-lang:ruby:2.4.2
  • Ruby-lang Ruby 2.4.3
    cpe:2.3:a:ruby-lang:ruby:2.4.3
  • Ruby-lang Ruby 2.4.4
    cpe:2.3:a:ruby-lang:ruby:2.4.4
  • Ruby-lang Ruby 2.5.0
    cpe:2.3:a:ruby-lang:ruby:2.5.0
  • Ruby-lang Ruby 2.5.0 Preview 1
    cpe:2.3:a:ruby-lang:ruby:2.5.0:preview1
  • Ruby-lang Ruby 2.5.1
    cpe:2.3:a:ruby-lang:ruby:2.5.1
  • Ruby-lang Ruby 2.6.0 Preview 1
    cpe:2.3:a:ruby-lang:ruby:2.6.0:preview1
  • Ruby-lang Ruby 2.6.0 Preview 2
    cpe:2.3:a:ruby-lang:ruby:2.6.0:preview2
  • Canonical Ubuntu Linux 14.04 LTS (Long-Term Support)
    cpe:2.3:o:canonical:ubuntu_linux:14.04:-:-:-:lts
  • Canonical Ubuntu Linux 16.04 LTS (Long-Term Support)
    cpe:2.3:o:canonical:ubuntu_linux:16.04:-:-:-:lts
  • Canonical Ubuntu Linux 18.04 LTS Edition
    cpe:2.3:o:canonical:ubuntu_linux:18.04:-:-:-:lts
  • Canonical Ubuntu Linux 18.10
    cpe:2.3:o:canonical:ubuntu_linux:18.10
  • Debian Linux 8.0 (Jessie)
    cpe:2.3:o:debian:debian_linux:8.0
  • Debian Linux 9.0
    cpe:2.3:o:debian:debian_linux:9.0
CVSS
Base: 7.5
Impact:
Exploitability:
CWE CWE-19
CAPEC
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • XML Nested Payloads
    Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. By nesting XML data and causing this data to be continuously self-referential, an attacker can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization. An attacker's goal is to leverage parser failure to his or her advantage. In most cases this type of an attack will result in a denial of service due to an application becoming unstable, freezing, or crash. However it may be possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [R.230.1].
  • XML Oversized Payloads
    Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. By supplying oversized payloads in input vectors that will be processed by the XML parser, an attacker can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization, and potentially cause execution of arbitrary code. An attacker's goal is to leverage parser failure to his or her advantage. In many cases this type of an attack will result in a denial of service due to an application becoming unstable, freezing, or crash. However it is possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [R.231.1].
  • XML Client-Side Attack
    Client applications such as web browsers that process HTML data often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintended system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser. [R.484.1]
  • XML Parser Attack
    Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintended system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser. [R.99.1]
nessus via4
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2018-6070BCF454.NASL
    description - Update to Ruby 2.5.3. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen 2019-02-21
    modified 2019-01-03
    plugin id 120464
    published 2019-01-03
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=120464
    title Fedora 28 : ruby (2018-6070bcf454)
  • NASL family Debian Local Security Checks
    NASL id DEBIAN_DSA-4332.NASL
    description Several vulnerabilities have been discovered in the interpreter for the Ruby language. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2018-16395 Tyler Eckstein reported that the equality check of OpenSSL::X509::Name could return true for non-equal objects. 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. - CVE-2018-16396 Chris Seaton discovered that tainted flags are not propagated in Array#pack and String#unpack with some directives.
    last seen 2019-02-21
    modified 2018-12-18
    plugin id 118721
    published 2018-11-05
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=118721
    title Debian DSA-4332-1 : ruby2.3 - security update
  • NASL family Oracle Linux Local Security Checks
    NASL id ORACLELINUX_ELSA-2018-3738.NASL
    description From Red Hat Security Advisory 2018:3738 : An update for ruby is now available for Red Hat Enterprise Linux 7. Red Hat Product Security has rated this update as having a security impact of Important. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. Ruby is an extensible, interpreted, object-oriented, scripting language. It has features to process text files and to perform system management tasks. Security Fix(es) : * ruby: OpenSSL::X509::Name equality check does not work correctly (CVE-2018-16395) For more details about the security issue(s), including the impact, a CVSS score, and other related information, refer to the CVE page(s) listed in the References section.
    last seen 2019-02-21
    modified 2018-12-18
    plugin id 119293
    published 2018-11-30
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=119293
    title Oracle Linux 7 : ruby (ELSA-2018-3738)
  • NASL family Red Hat Local Security Checks
    NASL id REDHAT-RHSA-2018-3738.NASL
    description An update for ruby is now available for Red Hat Enterprise Linux 7. Red Hat Product Security has rated this update as having a security impact of Important. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. Ruby is an extensible, interpreted, object-oriented, scripting language. It has features to process text files and to perform system management tasks. Security Fix(es) : * ruby: OpenSSL::X509::Name equality check does not work correctly (CVE-2018-16395) For more details about the security issue(s), including the impact, a CVSS score, and other related information, refer to the CVE page(s) listed in the References section.
    last seen 2019-02-21
    modified 2018-12-20
    plugin id 119294
    published 2018-11-30
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=119294
    title RHEL 7 : ruby (RHSA-2018:3738)
  • NASL family Amazon Linux Local Security Checks
    NASL id AL2_ALAS-2019-1143.NASL
    description 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.(CVE-2018-16395)
    last seen 2019-02-21
    modified 2019-01-10
    plugin id 121052
    published 2019-01-10
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=121052
    title Amazon Linux 2 : ruby (ALAS-2019-1143)
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2018-190ECD2EF8.NASL
    description - Update to Ruby 2.4.5. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen 2019-02-21
    modified 2018-12-18
    plugin id 119106
    published 2018-11-23
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=119106
    title Fedora 27 : ruby (2018-190ecd2ef8)
  • NASL family Amazon Linux Local Security Checks
    NASL id ALA_ALAS-2018-1113.NASL
    description 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.(CVE-2018-16395) An issue was discovered 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. It does not taint strings that result from unpacking tainted strings with some formats.(CVE-2018-16396)
    last seen 2019-02-21
    modified 2018-12-18
    plugin id 119472
    published 2018-12-07
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=119472
    title Amazon Linux AMI : ruby23 / ruby24 (ALAS-2018-1113)
  • NASL family Debian Local Security Checks
    NASL id DEBIAN_DLA-1558.NASL
    description CVE-2018-16395 Fix for OpenSSL::X509::Name equality check. CVE-2018-16396 Tainted flags are not propagated in Array#pack and String#unpack with some directives. For Debian 8 'Jessie', these problems have been fixed in version 2.1.5-2+deb8u6. We recommend that you upgrade your ruby2.1 packages. NOTE: Tenable Network Security has extracted the preceding description block directly from the DLA security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen 2019-02-21
    modified 2018-12-18
    plugin id 118471
    published 2018-10-29
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=118471
    title Debian DLA-1558-1 : ruby2.1 security update
  • NASL family Scientific Linux Local Security Checks
    NASL id SL_20181130_RUBY_ON_SL7_X.NASL
    description Security Fix(es) : - ruby: OpenSSL::X509::Name equality check does not work correctly (CVE-2018-16395)
    last seen 2019-02-21
    modified 2018-12-27
    plugin id 119444
    published 2018-12-06
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=119444
    title Scientific Linux Security Update : ruby on SL7.x x86_64
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2018-319B9D0F68.NASL
    description - Update to Ruby 2.5.3. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen 2019-02-21
    modified 2019-01-03
    plugin id 120334
    published 2019-01-03
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=120334
    title Fedora 29 : ruby (2018-319b9d0f68)
  • NASL family FreeBSD Local Security Checks
    NASL id FREEBSD_PKG_AFC604840652440EB01A5EF814747F06.NASL
    description Ruby news : CVE-2018-16395: OpenSSL::X509::Name equality check does not work correctly 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. CVE-2018-16396: Tainted flags are not propagated in Array#pack and String#unpack with some directives Array#pack method converts the receiver's contents into a string with specified format. If the receiver contains some tainted objects, the returned string also should be tainted. String#unpack method which converts the receiver into an array also should propagate its tainted flag to the objects contained in the returned array. But, with B, b, H and h directives, the tainted flags are not propagated. So, if a script processes unreliable inputs by Array#pack and/or String#unpack with these directives and checks the reliability with tainted flags, the check might be wrong.
    last seen 2019-02-21
    modified 2018-12-19
    plugin id 118247
    published 2018-10-22
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=118247
    title FreeBSD : ruby -- multiple vulnerabilities (afc60484-0652-440e-b01a-5ef814747f06)
  • NASL family CentOS Local Security Checks
    NASL id CENTOS_RHSA-2018-3738.NASL
    description An update for ruby is now available for Red Hat Enterprise Linux 7. Red Hat Product Security has rated this update as having a security impact of Important. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. Ruby is an extensible, interpreted, object-oriented, scripting language. It has features to process text files and to perform system management tasks. Security Fix(es) : * ruby: OpenSSL::X509::Name equality check does not work correctly (CVE-2018-16395) For more details about the security issue(s), including the impact, a CVSS score, and other related information, refer to the CVE page(s) listed in the References section.
    last seen 2019-02-21
    modified 2018-12-18
    plugin id 119665
    published 2018-12-14
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=119665
    title CentOS 7 : ruby (CESA-2018:3738)
redhat via4
advisories
  • bugzilla
    id 1643086
    title CVE-2018-16395 ruby: OpenSSL::X509::Name equality check does not work correctly
    oval
    AND
    • OR
      • comment Red Hat Enterprise Linux 7 Client is installed
        oval oval:com.redhat.rhsa:tst:20140675001
      • comment Red Hat Enterprise Linux 7 Server is installed
        oval oval:com.redhat.rhsa:tst:20140675002
      • comment Red Hat Enterprise Linux 7 Workstation is installed
        oval oval:com.redhat.rhsa:tst:20140675003
      • comment Red Hat Enterprise Linux 7 ComputeNode is installed
        oval oval:com.redhat.rhsa:tst:20140675004
    • OR
      • AND
        • comment ruby is earlier than 0:2.0.0.648-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738009
        • comment ruby is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20110910006
      • AND
        • comment ruby-devel is earlier than 0:2.0.0.648-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738007
        • comment ruby-devel is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20110910016
      • AND
        • comment ruby-doc is earlier than 0:2.0.0.648-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738031
        • comment ruby-doc is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912028
      • AND
        • comment ruby-irb is earlier than 0:2.0.0.648-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738033
        • comment ruby-irb is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20110910018
      • AND
        • comment ruby-libs is earlier than 0:2.0.0.648-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738011
        • comment ruby-libs is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20110910020
      • AND
        • comment ruby-tcltk is earlier than 0:2.0.0.648-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738017
        • comment ruby-tcltk is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20110910008
      • AND
        • comment rubygem-bigdecimal is earlier than 0:1.2.0-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738005
        • comment rubygem-bigdecimal is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912020
      • AND
        • comment rubygem-io-console is earlier than 0:0.4.2-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738013
        • comment rubygem-io-console is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912026
      • AND
        • comment rubygem-json is earlier than 0:1.7.7-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738019
        • comment rubygem-json is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912012
      • AND
        • comment rubygem-minitest is earlier than 0:4.3.2-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738021
        • comment rubygem-minitest is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912018
      • AND
        • comment rubygem-psych is earlier than 0:2.0.0-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738015
        • comment rubygem-psych is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912034
      • AND
        • comment rubygem-rake is earlier than 0:0.9.6-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738027
        • comment rubygem-rake is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912032
      • AND
        • comment rubygem-rdoc is earlier than 0:4.0.0-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738023
        • comment rubygem-rdoc is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912024
      • AND
        • comment rubygems is earlier than 0:2.0.14.1-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738029
        • comment rubygems is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20131441006
      • AND
        • comment rubygems-devel is earlier than 0:2.0.14.1-34.el7_6
          oval oval:com.redhat.rhsa:tst:20183738025
        • comment rubygems-devel is signed with Red Hat redhatrelease2 key
          oval oval:com.redhat.rhsa:tst:20141912014
    rhsa
    id RHSA-2018:3738
    released 2018-11-29
    severity Important
    title RHSA-2018:3738: ruby security update (Important)
  • rhsa
    id RHSA-2018:3729
  • rhsa
    id RHSA-2018:3730
  • rhsa
    id RHSA-2018:3731
rpms
  • ruby-0:2.0.0.648-34.el7_6
  • ruby-devel-0:2.0.0.648-34.el7_6
  • ruby-doc-0:2.0.0.648-34.el7_6
  • ruby-irb-0:2.0.0.648-34.el7_6
  • ruby-libs-0:2.0.0.648-34.el7_6
  • ruby-tcltk-0:2.0.0.648-34.el7_6
  • rubygem-bigdecimal-0:1.2.0-34.el7_6
  • rubygem-io-console-0:0.4.2-34.el7_6
  • rubygem-json-0:1.7.7-34.el7_6
  • rubygem-minitest-0:4.3.2-34.el7_6
  • rubygem-psych-0:2.0.0-34.el7_6
  • rubygem-rake-0:0.9.6-34.el7_6
  • rubygem-rdoc-0:4.0.0-34.el7_6
  • rubygems-0:2.0.14.1-34.el7_6
  • rubygems-devel-0:2.0.14.1-34.el7_6
refmap via4
confirm
debian DSA-4332
misc https://hackerone.com/reports/387250
mlist [debian-lts-announce] 20181028 [SECURITY] [DLA 1558-1] ruby2.1 security update
sectrack 1042105
ubuntu USN-3808-1
Last major update 16-11-2018 - 13:29
Published 16-11-2018 - 13:29
Last modified 28-02-2019 - 17:07
Back to Top