Use-after-free in GNOME libxml2 when an XML reader closes after a DTD validation error

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-137072?

CVE-2026-137072 is a vulnerability classified as Use After Free, affecting libxml2 (affected versions: 2.9.10 – ≤ 2.15.4). This vulnerability is rated Medium, with a CVSS score of 5.8. Current sources do not report this vulnerability as exploited.

Overview

Original source data

GNOME libxml2 2.9.10 through 2.15.4 contains a use-after-free vulnerability that allows attackers to trigger stale DTD validation states after xmlTextReaderCurrentDoc documents are freed. Attackers can supply an XML document ending with an error inside an element, causing xmlTextReaderClose to read freed element declarations, leading to crashes and possible invalid frees.

Affected products and scope

The record lists a single contiguous libxml2 release range as affected, spanning an older 2.9 series release through the current 2.15 series release; the exact bounds are rendered on this page. Releases outside that range, including earlier ones, are not marked affected. Because libxml2 is usually reached indirectly, the practical scope is any product, distribution package, container image or statically linked binary that ships a libxml2 from inside that range and parses XML with the reader interface. Applications that never enable DTD validation in that interface, or that never parse untrusted XML, are exposed far less.

Technical details

The weakness is CWE-416, use-after-free, in libxml2's reader and DTD validation path. DTD, Document Type Definition, is the older schema mechanism XML uses to constrain the structure of a document. When an application drives parsing through the xmlTextReader API with validation enabled, libxml2 holds a pointer to the current document, xmlTextReaderCurrentDoc. The record states that this document can be freed while DTD validation state still refers to it, leaving that state stale. If the input XML ends with an error inside an element, the close path, xmlTextReaderClose, goes on to read element declarations that were already freed, and the advisory reference names the pop step of validation as where the stale state is consumed. The trigger is therefore document structure and parse failure ordering, not a specific payload; public detail beyond the record is limited.

Exploitability

The record's vector is local, with high attack complexity and no privileges required, and user interaction is needed for the crafted document to be parsed. That combination describes an attacker who does not need an account on the target but does need to get a file or stream in front of vulnerable code, and who needs the conditions of the bug to line up. No public exploit is recorded and the record does not mark this as exploited in the wild.

Technical impact

An attacker gains the ability to abort the parsing process, which is a reliable denial of service against anything that repeatedly handles their input. Because the freed element declarations are read and can lead to invalid frees, memory corruption is also on the table, and the record allows for a low confidentiality impact. Integrity impact is none and no code execution is claimed. The main limit is reachability: the vulnerable path needs an application that uses the streaming reader with DTD validation, and the crafted document has to reach it.

Business impact

Any application that accepts XML from an untrusted source and parses it with libxml2's reader interface can be brought down by a single crafted document. That is an availability problem: a document ingestion queue, a feed processor, a SOAP endpoint or a file import feature stops serving, and if the input is replayed the process can be crashed repeatedly. The record also allows for a limited loss of confidentiality and for invalid frees, which means memory corruption is possible, though no code execution is claimed. Integrity impact is none. Teams that should care are the ones running or shipping XML-consuming services, and anyone maintaining a product that bundles libxml2 rather than taking it from the operating system, because an update to the system library will not reach a statically linked copy.

Remediation

Update libxml2 to a release outside the affected range, from your distribution or from upstream, and rebuild or re-release anything that links it statically or vendors a copy. The record marks a patch as available but does not describe a configuration workaround. Where a fix cannot be applied immediately, the effective control is upstream of the library: stop untrusted XML from reaching the reader path, or parse it in a process whose crash does not take down anything you need.

Detection

Watch for abnormal termination and crash reports in processes that parse XML, especially where libxml2 is loaded and the reader interface with DTD validation is in use. Since the trigger is a document that ends with an error inside an element, the interesting events cluster around XML parse failures and the shutdown of a reader after a failure. Log and retain the input that preceded a parser crash where your data handling rules permit it. On the inventory side, check which deployed software links libxml2 and whether it takes the library from the operating system or bundles its own copy, since only the first is fixed by a system update.

Sources (7)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.