Live threats

All CVEs / Nokogiri

CVE-2021-41098Nokogiri

High 7.5 No auth needed

Priority
60
CVSS 3.1
7.5
EPSS
1.5%
probability of exploitation in 30 days · percentile 74
Auth required
No
Published
Sep 27, 2021
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-611
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Nokogiri.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
RubyGems nokogiri < 1.12.5 1.12.5 gem "nokogiri", ">= 1.12.5"

Per OSV / GitHub Advisories (GHSA-2rr5-8q37-2w7h). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
nokogirinokogiri< 1.12.5

Official advisories

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.