External risk intelligence

Nokogiri Vulnerabilities Through Bundled Libraries

CVE advisorySeverity: CRITICAL (CVSS 9.3)

CVE-2022-51000

Nokogiri is a library used by developers within applications to parse XML/HTML. While applications utilizing the library may be internet-facing and process untrusted input, the library itself is a dependency rather than a standalone network service or edge appliance. Exposure depends entirely on how an application integrates and uses the library to process externally reachable data.

Use After Free

Halo Surface Signal: 3 out of 5 — possibly public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This advisory concerns vulnerabilities within the Nokogiri library, specifically affecting how it processes XML and XSL stylesheets. If an application uses this library to transform or parse untrusted documents, it could be exposed to denial-of-service attacks, potential memory disclosure, or even code execution. The main concern is confirming relevance and exposure, as the impact depends on how applications integrate and use the library.

  • Affects how applications process XML data.
  • Matters for applications parsing untrusted stylesheets.
  • Confirm relevance and exposure for impacted systems.

Attack Path

How an attacker could exploit the issue

An attacker could reach an XML processing component within an application that uses Nokogiri. This exposure would allow an attacker to submit specially crafted XML or XSLT documents, leading to potential denial-of-service, memory disclosure, or even code execution.

  • Requires no special access.
  • Triggered by untrusted XML/XSLT input.
  • Risks denial-of-service or code execution.

Live Threat

Current exploitation, exposure, and threat context

When an application uses Nokogiri to transform XML with untrusted XSL stylesheets or parse untrusted documents with specific options, it could be vulnerable to denial-of-service attacks, memory disclosure, or code execution.

  • Application XML processing.
  • Malicious XML or XSLT input.
  • System compromise or data exposure.

Operational Fix

Recommended remediation, mitigation, and detection steps

The responsibility for addressing this vulnerability likely falls to application owners and platform teams who manage the Nokogiri library within their development environments. The first practical step is to identify all applications using Nokogiri, assess their exposure to untrusted input, and confirm if they are business-critical. This will enable prioritizing remediation efforts and coordinating with relevant teams, including potentially vendor-management if Nokogiri is part of a third-party solution.

  • Application owners should own the remediation.
  • Verify untrusted input processing by applications.
  • Plan and execute updates during maintenance windows.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is Nokogiri?

Nokogiri is a widely used software library for the Ruby programming language. It acts as a bridge, allowing developers to easily parse, search, and manipulate XML and HTML documents within their applications. Because it is a dependency rather than a standalone program, its functionality is embedded directly into the custom software and services that rely on it for data processing.

What does CVE-2022-51000 mean?

This CVE highlights a Use After Free (CWE-416) vulnerability stemming from the older versions of libxml2 and libxslt libraries bundled inside Nokogiri. In plain terms, the software can fail to manage memory correctly when processing complex files. If an attacker provides a specially crafted XML or XSLT document, the application may crash, leak sensitive memory, or potentially allow unauthorized execution of commands.

How is this vulnerability triggered?

The flaw is triggered when an application uses Nokogiri to process untrusted XML data or malicious XSL stylesheets. It is important to note that simply having the library installed is not enough to be at risk. The vulnerability requires the application code to actively parse input from external sources using specific, vulnerable configurations—specifically when DTD validation is enabled and entity substitution is restricted.

Is my application at risk?

According to Halo Surface Signal, risk depends on how your application uses the library. Since Nokogiri is a component rather than an internet-facing appliance, it only becomes a target if your application is internet-facing and designed to process untrusted data from users. You should check if your software accepts and parses external XML or XSLT files, as this is the primary pathway for exploitation.

What is the first step for fixing this?

Application owners should start by creating an inventory of all software using Nokogiri to identify which systems process untrusted input. Once identified, the primary fix is to update the application to use Nokogiri version 1.13.2 or later, which includes patched versions of the underlying libxml2 and libxslt libraries. Coordinate these updates during standard maintenance windows to minimize disruption.

References