CVE-2015-5312: Nokogiri Denial of Service Vulnerability
HIGHCVE-2015-5312 is a HIGH denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves nokogiri subject to dos via libxml2 vulnerability. Remediation is available by upgrading affected packages to version 1.6.7.1.
CVE-2015-5312 at a Glance
How to Fix CVE-2015-5312
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.
Upgrade nokogiri to 1.6.7.1
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-5312, 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.7.1), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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
CVE-2015-5312 Affected Nokogiri Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nokogiri
|
RubyGems |
≥ 1.6.0
< 1.6.7.1
|
1.6.7.1
|
References
Frequently Asked Questions
What is CVE-2015-5312?
Which Nokogiri versions are affected?
What version fixes CVE-2015-5312?
Is nokogiri affected?
What CWE is associated with CVE-2015-5312?
How can I check RubyGems dependencies for CVE-2015-5312?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xjqg-9jvg-fgx2",
"modified" : "2023-03-13T23:53:36Z",
"published" : "2018-08-21T19:03:04Z",
"aliases" : [ "CVE-2015-5312" ],
"summary" : "Nokogiri subject to DoS via libxml2 vulnerability",
"details" : "The xmlStringLenDecodeEntities function in parser.c in libxml2 before 2.9.3 (as used in nokogiri before 1.6.7.1) does not properly prevent entity expansion, which allows context-dependent attackers to cause a denial of service (CPU consumption) via crafted XML data, a different vulnerability than CVE-2014-3660.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "nokogiri"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.6.0"
}, {
"fixed" : "1.6.7.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.6.7.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-5312"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1276693"
}, {
"type" : "WEB",
"url" : "https://git.gnome.org/browse/libxml2/commit/?id=69030714cde66d525a8884bda01b9e8f0abf8e1e"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2015-5312.yml"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/forum/#!topic/ruby-security-ann/aSbgDiwb24s"
}, {
"type" : "WEB",
"url" : "https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c04944172"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/201701-37"
}, {
"type" : "WEB",
"url" : "https://support.apple.com/HT206166"
}, {
"type" : "WEB",
"url" : "https://support.apple.com/HT206167"
}, {
"type" : "WEB",
"url" : "https://support.apple.com/HT206168"
}, {
"type" : "WEB",
"url" : "https://support.apple.com/HT206169"
}, {
"type" : "WEB",
"url" : "http://lists.apple.com/archives/security-announce/2016/Mar/msg00000.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-updates/2015-12/msg00120.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-updates/2016-01/msg00031.html"
}, {
"type" : "WEB",
"url" : "http://marc.info/?l=bugtraq&m=145382616617563&w=2"
}, {
"type" : "WEB",
"url" : "http://rhn.redhat.com/errata/RHSA-2015-2549.html"
}, {
"type" : "WEB",
"url" : "http://rhn.redhat.com/errata/RHSA-2015-2550.html"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2015/dsa-3430"
}, {
"type" : "WEB",
"url" : "http://www.oracle.com/technetwork/topics/security/bulletinjan2016-2867206.html"
}, {
"type" : "WEB",
"url" : "http://www.oracle.com/technetwork/topics/security/linuxbulletinoct2015-2719645.html"
}, {
"type" : "WEB",
"url" : "http://www.ubuntu.com/usn/USN-2834-1"
}, {
"type" : "WEB",
"url" : "http://xmlsoft.org/news.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T22:03:39Z",
"nvd_published_at" : null
}
}