CVE-2026-137069 in libxml2
Summary
by MITRE • 11/25/2026
libxml2 2.13.0 through 2.15.4 contains a denial of service vulnerability because xmlTextReaderSetup does not reset reader->state when a reader is reused. Attackers can submit one malformed XML document to an application reusing a single reader, causing every later document to be rejected until the reader is recreated.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/25/2026
The vulnerability identified in libxml2 versions 2.13.0 through 2.15.4 represents a significant reliability issue within the library's XML parsing infrastructure, specifically affecting applications that utilize persistent or reused xmlTextReader instances for processing multiple documents. This flaw is rooted in improper state management during the lifecycle of an XML reader object. When an application reuses a single reader instance to parse successive XML streams without fully resetting its internal context, the parser retains residual state information from previous parsing operations. The core technical defect lies within the xmlTextReaderSetup function, which fails to clear or reset the reader->state variable when preparing for a new document. This oversight means that if an initial malformed XML document causes the reader to enter an error state or leave internal flags set in a specific configuration, subsequent valid documents processed by the same reader instance will be incorrectly evaluated against this corrupted state.
From a technical perspective, this behavior constitutes a logic error that leads to a denial of service condition for legitimate users. Because the reader does not properly reset its internal status upon initialization for a new document, any prior parsing errors or incomplete states can propagate forward. Consequently, once an attacker submits one carefully crafted malformed XML document, the reader becomes permanently stuck in a rejected state for all subsequent documents until the application explicitly recreates the reader object from scratch. This effectively disables the functionality of that specific parser instance indefinitely within the current process context, forcing applications to either crash if they do not handle this persistent error gracefully or suffer a complete halt in processing capabilities for any data routed through that reader.
The operational impact of this vulnerability is particularly severe in high-throughput environments where performance optimization techniques involve reusing expensive-to-allocate resources like XML readers. In web services, API gateways, or document management systems that process multiple requests per connection or within a single thread pool worker, an attacker can trigger this condition with minimal effort by sending a single malformed payload. Once triggered, the service may become unresponsive to new legitimate traffic if it relies on pre-allocated reader instances for efficiency. This results in a localized denial of service where specific endpoints or processing threads are rendered useless without requiring resource exhaustion attacks such as memory flooding or CPU spikes. The persistence of this state until object recreation makes mitigation difficult for applications that do not implement robust error recovery mechanisms, potentially leading to cascading failures if the application attempts to recover by retrying with the same corrupted reader instance repeatedly.
This vulnerability aligns with CWE-20 Improper Input Validation and CWE-367 Time-of-check Time-of-use (TOCTOU) race conditions in state management, as it involves a failure to properly validate or reset internal states before processing new input. In terms of attack vectors, this falls under the ATT&CK technique T1499 Endpoint Denial of Service, specifically via resource exhaustion through logic flaws rather than brute force. To mitigate this risk, developers should ensure that any reused xmlTextReader instances are explicitly closed and destroyed after each use, creating a fresh instance for every new document to guarantee state isolation. Alternatively, if reuse is mandatory for performance reasons, the application must implement explicit reset routines or verify the reader's internal state before processing subsequent documents, ensuring that error states from previous parses do not contaminate future operations. Upgrading libxml2 to version 2.15.5 or later resolves this issue by correcting the xmlTextReaderSetup logic to properly initialize and clear all relevant state variables upon reuse.