CVE-2021-41098 json
Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby
published 5y ago modified 4mo ago also GHSA-2rr5-8q37-2w7h , EUVD-2021-1954
- cvss
- 7.5
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.5%
- EPSS 1.5% chance of exploitation in 30 days, percentile 73%
- public exploits
- 0
- none known
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.
Patch / fix
- rubygems nokogiri 1.12.5
- nokogiri nokogiri 1.12.5
- rubygem-nokogiri openSUSE Tumbleweed 1.18.9-1.4
- rubygem-nokogiri openSUSE Tumbleweed 1.18.2-1.1
- rubygem-nokogiri openSUSE Tumbleweed 1.15.5-1.5
- rubygem-nokogiri openSUSE Tumbleweed 1.12.5-1.1
- rubygem-nokogiri openSUSE Tumbleweed 1.13.3-1.1
- ruby3.2-rubygem-nokogiri openSUSE Tumbleweed 1.13.9-1.7
opensuse advisories openSUSE-SU-2026:10356-1openSUSE-SU-2025:14697-1openSUSE-SU-2024:14174-1openSUSE-SU-2024:11577-1openSUSE-SU-2024:11912-1openSUSE-SU-2024:13165-1
Is CVE-2021-41098 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-41098 updated cvss 7.5
rubygem-nokogiri: XEE on JRuby
-
Red Hat 3scale API Management Platform 2 nokogiriaffected: no fix planned “Will not fix”
-
Red Hat CloudForms Management Engine 5 rubygem-nokogiri Red Hat Advanced Cluster Management for Kubernetes 2 3scale_amp Red Hat Satellite 6 tfm-rubygem-nokogiri, tfm-ror52-rubygem-nokogirinot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
1.46% chance of exploitation in the next 30 days, higher than 73% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
| GitHub | 3.0 | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | nokogiri | <1.12.5 |
1.12.5 |
Affected products
- sparklemotion nokogiri
Classification
- Weakness
-
- CWE-611 Improper Restriction of XML External Entity Reference
References
-
github.com
/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6d
web, patch, third-party-advisory
-
github.com
/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7h
web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-41098
advisory
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2021-41098.yml
web
-
github.com
/sparklemotion/nokogiri
package
Sources
- CVE List CVE-2021-41098
- GitHub Advisory GHSA-2rr5-8q37-2w7h
- NVD CVE-2021-41098
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.