CVE-2012-6685
Description
Nokogiri before 1.5.4 is vulnerable to XXE attacks
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Nokogiri before 1.5.4 is vulnerable to XXE attacks, allowing remote attackers to read local files or conduct SSRF via external XML entities.
CVE-2012-6685 describes an XML eXternal Entity (XXE) vulnerability in Nokogiri, a Ruby gem for parsing XML and HTML documents. Versions prior to 1.5.4 did not properly disable external entity processing, allowing attackers to supply malicious XML that references external resources. The root cause is the lack of a secure default configuration to prevent XXE attacks during XML parsing [1] [3].
Exploitation
An attacker can exploit this flaw by crafting an XML document that includes external entity definitions pointing to local files or remote URLs. When a vulnerable version of Nokogiri parses this input, it will attempt to load the specified entity, potentially reading sensitive files from the server's filesystem or making outbound connections to arbitrary hosts. No authentication is required if the application exposes a parser endpoint to unauthenticated users [3].
Impact
Successful exploitation can lead to information disclosure (e.g., reading /etc/passwd) or server-side request forgery (SSRF) by forcing the server to issue requests to internal or external hosts. The initial fix in Nokogiri 1.5.4 introduced a nonet option to disable network connections, but this did not prevent access to local file URLs; only the upgrade to libxml2 2.9.0 in Nokogiri 1.6.4 fully resolved the issue [3] [4].
Mitigation
Users should upgrade to Nokogiri 1.6.4 or later, which uses libxml2 >= 2.9.0 that securely disables external entity expansion by default. For systems where an immediate upgrade is not feasible, the application can be hardened by setting the nonet option to true and explicitly overriding default parser settings to disallow DTD loading, though this workaround may not fully protect against local file inclusion [3].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
nokogiriRubyGems | < 1.5.4 | 1.5.4 |
Affected products
2- Nokogiri/Nokogiridescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-6wj9-77wq-jq7pghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2012-6685ghsaADVISORY
- bugzilla.redhat.com/show_bug.cgighsax_refsource_MISCWEB
- github.com/sparklemotion/nokogiri/issues/693ghsax_refsource_CONFIRMWEB
- nokogiri.org/CHANGELOG.htmlghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.