CVE-2015-8806: Nokogiri Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-7hp2-xwpj-95jq
CVSS 7.5
CWE-125
Published
Advisory Summary

CVE-2015-8806 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-125: Out-of-bounds Read) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves denial of service or rce from libxml2 and libxslt. Remediation is available by upgrading affected packages to version 1.6.8.

CVE-2015-8806 at a Glance

CVE Identifier CVE-2015-8806
GHSA Identifier GHSA-7hp2-xwpj-95jq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Nokogiri
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2015-8806

To remediate this vulnerability, upgrade all affected Nokogiri dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nokogiri fixed: 1.6.8
Upgrade nokogiri to 1.6.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for nokogiri

How to Check if You Are Affected

To determine whether your application is affected by CVE-2015-8806, inspect your project dependencies for Nokogiri:

inspect dependencies for nokogiri

Analyze the terminal output to locate any version of Nokogiri in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Nokogiri, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Nokogiri is affected by series of vulnerabilities in libxml2 and libxslt, which are libraries Nokogiri depends on. It was discovered that libxml2 and libxslt incorrectly handled certain malformed documents, which can allow malicious users to cause issues ranging from denial of service to remote code execution attacks.

CVE-2015-8806 Affected Nokogiri Versions

1 component(s)
Fixed Versions:
1.6.8
Product / Package Ecosystem Affected Versions Fixed Version
nokogiri
RubyGems
≥ 1.6.0
< 1.6.8
1.6.8

References

Frequently Asked Questions

What is CVE-2015-8806?
CVE-2015-8806 is a security vulnerability in Nokogiri involving Denial of service or RCE from libxml2 and libxslt under CWE-125: Out-of-bounds Read.
Which Nokogiri versions are affected?
Affected versions include releases prior to 1.6.8 across affected packages: nokogiri.
What version fixes CVE-2015-8806?
Upgrading to 1.6.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nokogiri affected?
Yes, nokogiri is affected in releases prior to 1.6.8. Upgrade your dependency to 1.6.8 or later.
What is the CVSS score of CVE-2015-8806?
CVE-2015-8806 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2015-8806?
CVE-2015-8806 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check RubyGems dependencies for CVE-2015-8806?
Run the dependency tree command: 'inspect dependencies for nokogiri'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7hp2-xwpj-95jq",
  "modified" : "2023-06-30T19:54:52Z",
  "published" : "2018-09-17T21:53:42Z",
  "aliases" : [ "CVE-2015-8806" ],
  "summary" : "Denial of service or RCE from libxml2 and libxslt",
  "details" : "Nokogiri is affected by series of vulnerabilities in libxml2 and libxslt, which are libraries Nokogiri depends on. It was discovered that libxml2 and libxslt incorrectly handled certain malformed documents, which can allow malicious users to cause issues ranging from denial of service to remote code execution attacks.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "nokogiri"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.6.0"
      }, {
        "fixed" : "1.6.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-8806"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/issues/1473"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.gnome.org/show_bug.cgi?id=749115"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2015-8806.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sparklemotion/nokogiri"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/201701-37"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20160928171015/http://www.securityfocus.com/bid/82071"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2016/dsa-3593"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/02/03/5"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/topics/security/bulletinjul2016-3090568.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.ubuntu.com/usn/USN-2994-1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:22:55Z",
    "nvd_published_at" : null
  }
}