CVE-2012-6685: Nokogiri Nokogiri Is Vulnerable To XML Vulnerability
HIGHCVE-2012-6685 is a HIGH (CVSS 7.5) nokogiri is vulnerable to xml vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves nokogiri is vulnerable to xml external entity (xxe) attack. Remediation is available by upgrading affected packages to version 1.5.4.
CVE-2012-6685 at a Glance
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:H/I:N/A:N).
How to Fix CVE-2012-6685
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.5.4
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-2012-6685, 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.5.4), 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-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where the product uses xml documents and allows their structure to be defined with a document type definition (dtd), but it does not properly control the number of recursive definitions of entities. 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-2012-6685 Affected Nokogiri Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nokogiri
|
RubyGems |
< 1.5.4
|
1.5.4
|
References
Frequently Asked Questions
What is CVE-2012-6685?
Which Nokogiri versions are affected?
What version fixes CVE-2012-6685?
Is nokogiri affected?
What is the CVSS score of CVE-2012-6685?
What CWE is associated with CVE-2012-6685?
How can I check RubyGems dependencies for CVE-2012-6685?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6wj9-77wq-jq7p",
"modified" : "2023-03-06T23:31:46Z",
"published" : "2022-04-23T00:40:45Z",
"aliases" : [ "CVE-2012-6685" ],
"summary" : "Nokogiri is vulnerable to XML External Entity (XXE) attack",
"details" : "Nokogiri before 1.5.4 is vulnerable to XXE attacks.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "nokogiri"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-6685"
}, {
"type" : "WEB",
"url" : "https://github.com/sparklemotion/nokogiri/issues/693"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1178970"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sparklemotion/nokogiri"
}, {
"type" : "WEB",
"url" : "https://nokogiri.org/CHANGELOG.html#154-2012-06-12"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-776" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-12T16:55:39Z",
"nvd_published_at" : "2020-02-19T15:15:00Z"
}
}