CVE-2021-41098: Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.71883%
CWE
Published
9/27/2021
Updated
5/4/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
nokogiri | rubygems | <= 1.12.4 | 1.12.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from SAX parsers resolving external entities by default on JRuby. The key fix in the commit adds NokogiriEntityResolver to XML SAX parsers (visible in XmlSaxParserContext.java's parse_with method). The absence of this resolver in vulnerable versions allowed XXE. The NokogiriHandler changes show error handling improvements related to entity resolution errors, indicating it was involved in the vulnerable flow. The high confidence for parse_with comes from direct security control (entity resolver) being missing, while medium confidence for NokogiriHandler reflects its secondary role in error handling during entity resolution.