CVE-2026-137074 in libxml2info

Summary

by MITRE • 11/25/2026

GNOME libxml2 2.12.6 through 2.15.4 contains a NULL pointer dereference vulnerability in xmlTextReaderConstEncoding() after a reader is reset with xmlReaderNewWalker(). Because xmlCtxtReset() leaves ctxt->input NULL, querying the document encoding makes xmlGetActualEncoding() read ctxt->input->flags without a check, crashing the application and causing denial of service.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability identified in GNOME libxml2 versions 2.12.6 through 2.15.4 represents a critical memory safety flaw rooted in improper state management during XML parsing operations. Specifically, this issue manifests within the xmlTextReaderConstEncoding function when it is invoked after a reader has been reset using the xmlReaderNewWalker method. The core technical deficiency lies in the interaction between context resetting and subsequent encoding queries. When an application calls xmlCtxtReset to reinitialize the parser context for processing new or modified XML data, this operation fails to properly initialize all internal pointers within that context structure. Most notably, it leaves the ctxt->input pointer as NULL rather than assigning a valid input source object. This oversight creates a dangerous state where subsequent API calls assume the presence of an active input stream without verifying its existence.

The exploitation vector for this vulnerability is triggered when code attempts to retrieve the actual encoding of the document by calling xmlGetActualEncoding after such a reset operation has occurred. Because the internal context still believes it might have valid data or because higher-level wrappers do not check the state before delegating, the function proceeds to access ctxt->input->flags. Since ctxt->input is NULL at this stage, any attempt to dereference this pointer results in an immediate segmentation fault. This null pointer dereference causes the application utilizing libxml2 to crash abruptly. The flaw does not require complex payload construction or specific XML content structures; it relies solely on the sequence of API calls made by the developer using the library. Consequently, if a service processes user-controlled input that triggers this reset-and-query pattern, an attacker can induce a denial of service condition simply by causing the application to execute these steps in rapid succession.

From a classification perspective, this vulnerability aligns with CWE-476, which denotes NULL Pointer Dereference vulnerabilities where software fails to check for null pointers before using them, leading to crashes or potential code execution if memory layout allows. In terms of adversarial tactics, this behavior can be mapped to the ATT&CK technique T1499, Endpoint Denial of Service, as it results in the disruption of availability through application termination. The impact is primarily focused on service stability and reliability rather than data confidentiality or integrity at this stage, although repeated crashes could facilitate more sophisticated attacks if combined with other memory corruption flaws to achieve arbitrary code execution via heap spraying techniques targeting the crash site.

Mitigation strategies for organizations relying on affected versions of libxml2 involve immediate patching to version 2.15.5 or later where these internal state checks have been corrected by upstream developers. For applications unable to update immediately, defensive programming practices should be implemented within the codebase that integrates libxml2. Developers must ensure that xmlCtxtReset is always followed by proper initialization of input sources before any queries regarding document properties like encoding are made. Additionally, implementing robust error handling and state validation checks around XML parsing loops can prevent accidental invocation of functions on invalid contexts. Regular security audits focusing on library usage patterns are recommended to identify similar misuse scenarios where API contracts regarding object lifecycle management are violated.

Responsible

VulnCheck

Reservation

11/25/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00270

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!