Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby
Description
Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parser resolves external entities by default. Users of Nokogiri on JRuby who parse untrusted documents using any of these classes are affected: Nokogiri::XML::SAX::Parse, Nokogiri::HTML4::SAX::Parser or its alias Nokogiri::HTML::SAX::Parser, Nokogiri::XML::SAX::PushParser, and Nokogiri::HTML4::SAX::PushParser or its alias Nokogiri::HTML::SAX::PushParser. JRuby users should upgrade to Nokogiri v1.12.5 or later to receive a patch for this issue. There are no workarounds available for v1.12.4 or earlier. CRuby users are not affected.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
nokogiriRubyGems | < 1.12.5 | 1.12.5 |
Affected products
4- ghsa-coords3 versionspkg:gem/nokogiripkg:rpm/opensuse/ruby3.2-rubygem-nokogiri&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/rubygem-nokogiri&distro=openSUSE%20Tumbleweed
< 1.12.5+ 2 more
- (no CPE)range: < 1.12.5
- (no CPE)range: < 1.13.9-1.7
- (no CPE)range: < 1.12.5-1.1
- Range: < 1.12.5
Patches
Vulnerability mechanics
References
5- github.com/advisories/GHSA-2rr5-8q37-2w7hghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-41098ghsaADVISORY
- github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2021-41098.ymlghsaWEB
- github.com/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6dghsax_refsource_MISCWEB
- github.com/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7hghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.