External risk intelligence

Nokogiri Stack Buffer Overflow and Use-After-Free Vulnerabilities.

CVE advisorySeverity: CRITICAL (CVSS 9.3)

CVE-2025-71407

Nokogiri is a library embedded within applications to process XML/XSD files. While it may be used by internet-facing web applications to parse untrusted user-supplied data, the library itself is not a standalone network service, edge gateway, or portal, and its exposure depends entirely on the specific implementation and context of the host application.

Out-of-bounds Write

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 describes vulnerabilities in the Nokogiri software library, which is used for processing XML and HTML. The issues could allow for denial of service or potentially the execution of malicious code if the software processes specially crafted data. The main concern is confirming if our organization uses this library and is therefore potentially exposed.

  • Vulnerabilities exist in XML processing software.
  • Understand if and how our systems use this library.
  • Confirm relevance and assess potential exposure.

Attack Path

How an attacker could exploit the issue

An attacker could exploit this vulnerability by sending specially crafted DTD or XSD data to an application that uses a vulnerable version of the Nokogiri library. This malicious input targets how the library handles validation errors and schema processing, potentially leading to unexpected behavior. If successful, an attacker could cause the application to crash, preventing legitimate users from accessing it, or, in some scenarios, execute their own code within the context of the application.

  • Requires an application using vulnerable Nokogiri.
  • Triggered by providing malicious DTD or XSD.
  • Risk of denial of service or code execution.

Live Threat

Current exploitation, exposure, and threat context

When supported by the advisory, applications processing XML data with long QName prefixes in DTDs or untrusted XML Schemas could experience crashes or unexpected behavior due to stack buffer overflows and use-after-free vulnerabilities.

  • Application processing of DTDs or XSD files.
  • Malicious DTD or untrusted XSD files provided.
  • Denial of service or potential code execution.

Operational Fix

Recommended remediation, mitigation, and detection steps

Teams responsible for applications embedding Nokogiri should investigate its usage, focusing on any instances processing untrusted DTD or XSD files. The initial step involves an inventory of where Nokogiri is deployed, assessing exposure through application context, and identifying the accountable application owner to prioritize remediation based on observed risk and potential business impact.

  • Application owners must manage this vulnerability.
  • Verify untrusted DTD or XSD processing.
  • Plan remediation based on application risk.

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 software library widely used by developers to parse, search, and manipulate XML and HTML documents. It serves as an interface for underlying C-based engines like libxml2, allowing applications to read and understand complex structured data formats. It is not a standalone application but a component embedded within larger software projects to handle data input tasks.

How does CVE-2025-71407 create a security weakness?

This CVE involves two memory safety issues: a stack buffer overflow and a use-after-free. These flaws occur when the library mismanages memory while processing specific XML components, such as long prefixes in Document Type Definitions (DTD) or untrusted XML Schema (XSD) files. This falls under the category of Out-of-bounds Write (CWE-787), where the software writes data past the end of a buffer, potentially leading to system instability or unauthorized command execution.

When is this vulnerability triggered?

The vulnerability is triggered only when a vulnerable version of Nokogiri processes malicious or malformed XML input, specifically crafted DTDs or untrusted XSD files. If an application uses Nokogiri but does not process external, untrusted, or user-supplied XML files containing these specific structures, the conditions required to exploit these memory errors are not met.

Is my system at risk according to Halo Surface Signal?

Halo Surface Signal notes that because Nokogiri is a library rather than a standalone network service, your risk depends entirely on the host application. If your application accepts and parses untrusted XML input from the internet, the risk is higher. If the library is used only for internal, trusted data processing, the practical accessibility for an attacker is significantly reduced.

How should I respond to this advisory?

The first step is to perform an inventory to identify which of your applications embed Nokogiri. Focus your investigation on any software components that process external or untrusted XML, DTD, or XSD files. Once identified, coordinate with the application owners to assess the risk and prioritize updating the library to a patched version to mitigate potential crashes or code execution risks.

References