CVE-2021-41098
CVE-2021-41098 is a high-severity vulnerability in Nokogiri with a CVSS 3.x base score of 7.5. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-611.
Key facts
- Severity: High (CVSS 3.x base score 7.5)
- CVSS v2: 5.0
- EPSS exploit prediction: 1% (69th percentile)
- Actively exploited: Not listed in CISA KEV
- Weakness: CWE-611
- Affected product: Nokogiri
- Published:
- Last modified:
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.
Frequently asked questions
- What is CVE-2021-41098?
- 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.
- How severe is CVE-2021-41098?
- CVE-2021-41098 has a CVSS 3.x base score of 7.5, rated high severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity none, and availability none.
- Is CVE-2021-41098 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (69th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2021-41098?
- CVE-2021-41098 affects Nokogiri. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2021-41098?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- When was CVE-2021-41098 published?
- CVE-2021-41098 was published on 2021-09-27 and last updated on 2026-06-17.
References
- https://github.com/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6d
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7h
Affected products (1)
- cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*
More vulnerabilities in Nokogiri
- CVE-2019-5477 — Critical (CVSS 9.8): A command injection vulnerability in Nokogiri v1.10.3 and earlier allows commands to be executed in a subprocess via…
- CVE-2026-57236 — High (CVSS 8.2): Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, calling…
- CVE-2026-57235 — High (CVSS 8.2): Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4,…
- CVE-2022-29181 — High (CVSS 8.2): Nokogiri is an open source XML and HTML library for Ruby. Nokogiri prior to version 1.13.6 does not type-check all…
- CVE-2026-57435 — High (CVSS 7.5): Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri’s CRuby…
- CVE-2026-57434 — High (CVSS 7.5): Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri contains a…
Other CWE-611 (Improper Restriction of XML External Entity Reference (XXE)) vulnerabilities
- CVE-2022-22486 — Critical (CVSS 10.0): IBM Tivoli Workload Scheduler 9.4, 9.5, and 10.1 is vulnerable to an XML External Entity Injection (XXE) attack when…
- CVE-2019-14678 — Critical (CVSS 10.0): SAS XML Mapper 9.45 has an XML External Entity (XXE) vulnerability that can be leveraged by malicious attackers in…
- CVE-2015-9280 — Critical (CVSS 10.0): MailEnable before 8.60 allows XXE via an XML document in the request.aspx Options parameter.
- CVE-2018-1000838 — Critical (CVSS 10.0): autopsy version <= 4.9.0 contains a XML External Entity (XXE) vulnerability in CaseMetadata XML Parser that can result…
- CVE-2018-1000837 — Critical (CVSS 10.0): UML Designer version <= 8.0.0 contains a XML External Entity (XXE) vulnerability in XML parser for plugins that can…
- CVE-2018-1000835 — Critical (CVSS 10.0): KeePassDX version <= 2.5.0.0beta17 contains a XML External Entity (XXE) vulnerability in kdbx file parser that can…
Browse all CWE-611 (Improper Restriction of XML External Entity Reference (XXE)) vulnerabilities →