# CVE-2021-41098: Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby

- Severity: High 7.5 (CVSS:3.0, scored by GitHub_M) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.46%, higher than 74% of CVEs (2026-12-01)
- Published: 2021-09-27T19:35:11.000Z
- Modified: 2026-07-08T06:28:52.471Z
- Also known as: GHSA-2rr5-8q37-2w7h
- Weaknesses: CWE-611
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- sparklemotion nokogiri: < 1.12.5
- nokogiri (RubyGems): before 1.12.5
- nokogiri nokogiri: before 1.12.5

## Every score

- GitHub_M: CVSS:3.0 7.5 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.0 7.5 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:P/I:N/A:N`

## References

- <https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7h> (third-party-advisory, web)
- <https://github.com/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6d> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-41098> (advisory)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2021-41098.yml> (web)
- <https://github.com/sparklemotion/nokogiri> (package)

## Sources

- CVE List: [CVE-2021-41098](https://www.cve.org/CVERecord?id=CVE-2021-41098), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-2rr5-8q37-2w7h](https://github.com/advisories/GHSA-2rr5-8q37-2w7h), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-41098](https://nvd.nist.gov/vuln/detail/CVE-2021-41098), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-41098 · Whole record: https://cve.day/CVE-2021-41098.json · Rebuilt by cve.day 2026-11-25T22:58:04.188Z
