LiveActive security incident?Get immediate response
CVE Record

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

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.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

This issue affects Nokogiri only when used on JRuby. In vulnerable versions, SAX parsing of untrusted XML or HTML can resolve external entities by default, which may expose sensitive data. CRuby deployments are not affected. The vendor says JRuby users should upgrade to Nokogiri 1.12.5 or later and that no workaround exists for earlier versions.

Executive priority

Treat this as a focused high-priority dependency fix for JRuby systems, especially internet-facing document ingestion paths. The scope is narrow, but the confirmed confidentiality impact and lack of workaround make upgrade the practical remediation path.

Technical view

CVE-2021-41098 is a CWE-611 XXE vulnerability in Nokogiri 1.12.4 and earlier on JRuby. Affected use is limited to listed SAX and PushParser classes parsing untrusted documents. CVSS 3.0 is 7.5 with network attack vector, low complexity, no privileges, no user interaction, and high confidentiality impact.

Likely exposure

Exposure is likely in JRuby applications that depend on Nokogiri before 1.12.5 and parse attacker-controlled XML or HTML through the affected SAX or PushParser classes. CRuby users are explicitly out of scope. Applications using other Nokogiri parsing paths are not confirmed affected by the provided sources.

Exploitation context

The CVE is not listed as KEV in the supplied data, and no cited source states active exploitation. The risk is still material because the CVSS vector indicates remote, unauthenticated, low-complexity confidentiality impact when vulnerable JRuby parsing paths receive untrusted documents.

Researcher notes

Affected classes include Nokogiri::XML::SAX::Parse, Nokogiri::HTML4::SAX::Parser and alias, XML SAX PushParser, and HTML4 SAX PushParser and alias. The key boundary is JRuby plus untrusted document parsing. The provided sources do not identify affected CPEs or active exploitation.

Mitigation direction

  • Upgrade JRuby deployments to Nokogiri 1.12.5 or later.
  • Do not rely on a workaround for Nokogiri 1.12.4 or earlier.
  • Prioritize services that parse user-supplied XML or HTML.
  • Confirm CRuby-only deployments are not mistakenly scoped as affected.
  • Review the vendor advisory before making remediation exceptions.

Validation and detection

  • Inventory applications running Nokogiri on JRuby.
  • Confirm installed Nokogiri versions are 1.12.5 or later.
  • Search code for affected SAX and PushParser class usage.
  • Verify whether those parsers process untrusted documents.
  • Document CRuby-only applications as not affected, with runtime evidence.
Prepared
Confidence
high
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-611: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-41098 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.0)
Known Exploited
No
Published

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.0HighCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N3.93.6Primary CVE score

Vulnerability scoring details

Base CVSS 3.0 score

7.5High
CVSS 3.0 vector shape for CVE-2021-41098Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
sparklemotionnokogiri< 1.12.5Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-611 · source CWE mapping

Improper Restriction of XML External Entity Reference

Improper Restriction of XML External Entity Reference represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.