XML External Entity (XXE) Injection Affecting nokogiri package, versions [,1.12.5)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
1.45% (71st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about XML External Entity (XXE) Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-NOKOGIRI-2368638
  • published26 Jan 2022
  • disclosed27 Sept 2021
  • creditUnknown

Introduced: 27 Sep 2021

CVE-2021-41098  (opens in a new tab)
CWE-611  (opens in a new tab)

How to fix?

Upgrade nokogiri to version 1.12.5 or higher.

Overview

Affected versions of this package are vulnerable to XML External Entity (XXE) Injection. 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.

CVSS Base Scores

version 3.1