Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-611 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| sparklemotion | nokogiri | before 1.12.5 | 1.12.5 | Patch available | CNA |
| — | nokogiri (RubyGems) | before 1.12.5 | 1.12.5 | Patch available | GHSA-2rr5-8q37-2w7h |
- nokogiri Vendorsparklemotion Affected before 1.12.5 Fixed in 1.12.5 Patch available CNA
- nokogiri (RubyGems) Vendor— Affected before 1.12.5 Fixed in 1.12.5 Patch available GHSA-2rr5-8q37-2w7h
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:* | before 1.12.5 | Vulnerable | sparklemotion |
- cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:* Versions before 1.12.5 Vulnerable ·sparklemotion
Remediation
- Fix · CNA nokogiri (sparklemotion) Fixed in 1.12.5
- Fix · GHSA-2rr5-8q37-2w7h nokogiri (RubyGems) Fixed in 1.12.5 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat 3scale API Management Platform 2 | Affected | No fix planned: Will not fix |
Not affected: 3 products
- CloudForms Management Engine 5
- Red Hat Advanced Cluster Management for Kubernetes 2
- Red Hat Satellite 6
Timeline
- 2026-10-02 Threatist record created from CVE-2021-41098
- 2026-10-03 Alias added: GHSA-2rr5-8q37-2w7h
References
Advisory 2
More sparklemotion Nokogiri vulnerabilities
- TI-2022-11724 Improper Handling of Unexpected Data Type in Nokogiri CVSS 3.1HIGH 8.2
- TI-2018-15259 zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if… CVSS 3.1HIGH 7.5
- TI-2019-03885 OS command injection in Nokogiri CVSS 3.1CRITICAL 9.8
- TI-2026-55247 Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer CVSS 4.0HIGH 8.7
- TI-2022-07536 Unchecked return value from xmlTextReaderExpand in Nokogiri CVSS 3.1HIGH 7.5
- TI-2022-08648 Inefficient Regular Expression Complexity in Nokogiri CVSS 3.1HIGH 7.5
Sources
- CVE-2021-41098 · CVE Program
- CVE-2021-41098 · NVD
- FIRST EPSS
- GHSA-2rr5-8q37-2w7h · GitHub Advisory Database · CC BY 4.0
- CVE-2021-41098 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences