CVE-2025-6021
NixOS vulnerability analysis and mitigation

Overview

CVE-2025-6021 is an integer overflow vulnerability in libxml2's xmlBuildQName() function that leads to a stack-based buffer overflow. The flaw arises from unsafe arithmetic when concatenating XML namespace prefix and local name components: the lengths, originally of type size_t, are cast to int, causing incorrect size calculations for large values. This can result in a memcpy with an extremely large size argument, triggering a stack buffer overflow and potential memory corruption or denial of service. All libxml2 versions before 2.14.4 are affected, along with downstream products including Red Hat Enterprise Linux 7–10, Red Hat OpenShift Container Platform 4.12–4.19, Red Hat JBoss Core Services, and IBM Rapid Infrastructure Automation. The vulnerability was published on June 12, 2025, and carries a CVSS v3.1 base score of 7.5 (High) (Red Hat CVE, Red Hat Bugzilla).

Technical details

The root cause is an integer overflow (CWE-190) in the xmlBuildQName() function within libxml2, which also leads to a stack-based buffer overflow (CWE-121) and out-of-bounds write (CWE-787). When constructing a qualified XML name by concatenating a namespace prefix and a local name, the function performs arithmetic on the string lengths using size_t values that are subsequently cast to int. For sufficiently large prefix or local name lengths, this cast causes integer wraparound, resulting in an undersized buffer allocation and a subsequent memcpy that writes far beyond the allocated stack buffer. The vulnerability is network-exploitable with no authentication or user interaction required — an attacker only needs to supply crafted XML content to an application that uses libxml2 for parsing. A proof-of-concept issue was filed on the GNOME GitLab tracker (GNOME GitLab, Red Hat Bugzilla).

Impact

Successful exploitation primarily results in denial of service through application crash due to memory corruption caused by the stack buffer overflow. In more complex scenarios, the out-of-bounds write could theoretically be leveraged for remote code execution, though this has not been demonstrated publicly. Because libxml2 is a widely embedded XML parsing library used in web servers, middleware, container platforms, and ICS/OT systems, the blast radius is broad — any internet-facing application that processes attacker-controlled XML is potentially at risk. Affected downstream products include Red Hat Enterprise Linux, OpenShift Container Platform, JBoss Core Services, IBM Rapid Infrastructure Automation, Hitachi Energy RTU500, SteamOS, and many Linux distributions (Red Hat CVE, CISA ICS Advisory).

Exploitability

A proof-of-concept issue demonstrating the vulnerability is publicly available on the GNOME GitLab issue tracker, but no weaponized exploit or in-the-wild exploitation has been reported as of the time of this report (GNOME GitLab). The EPSS score is approximately 0.04%, indicating a low current probability of exploitation in the wild. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No threat actor attribution has been identified. The vulnerability is detectable by multiple commercial scanners including Qualys and Nessus, which have published numerous detection plugins.

Exploitation steps

  1. Identify a target: Locate an internet-facing application or service that uses libxml2 (version < 2.14.4) to parse XML input — such as a web API, XML-based file upload endpoint, or XML-processing middleware.
  2. Craft malicious XML: Construct an XML document containing a namespace-qualified element name where the namespace prefix or local name is extremely long (e.g., tens of thousands of characters), sufficient to cause integer overflow when their lengths are summed and cast to int inside xmlBuildQName().
  3. Trigger XML parsing: Submit the crafted XML document to the target application via HTTP POST, file upload, API call, or any other input channel that feeds data into libxml2's parser.
  4. Trigger the overflow: The xmlBuildQName() function computes an incorrect (wrapped) buffer size due to the integer overflow, allocates an undersized stack buffer, and then performs a memcpy with the original large size, overwriting adjacent stack memory.
  5. Achieve denial of service (or code execution): The stack corruption causes the application to crash (DoS). In a more advanced scenario, an attacker with precise control over the overflow data and target environment could attempt to overwrite return addresses or function pointers to achieve code execution (Red Hat Bugzilla, GNOME GitLab).

Indicators of compromise

  • Network: Unusually large XML payloads submitted to XML-processing endpoints; HTTP requests containing namespace-qualified element names with extremely long prefix or local name strings (thousands of characters).
  • Logs: Application crash logs or core dumps originating from processes linked against libxml2; segmentation fault signals (SIGSEGV) or stack smashing errors in application logs; error messages referencing xmlBuildQName in stack traces.
  • Process: Unexpected termination or restart of XML-processing services (e.g., web servers, middleware); processes consuming abnormally high memory before crashing.
  • File System: Core dump files (core.*) generated in application working directories following crashes of libxml2-linked processes.

Mitigation and workarounds

The primary remediation is to upgrade libxml2 to version 2.14.4 or later, which contains the fix for this vulnerability (GNOME GitLab). Red Hat has issued security advisories for all affected RHEL versions: RHSA-2025:10630 (RHEL 10), RHSA-2025:10698 (RHEL 8), RHSA-2025:10699 (RHEL 9), and numerous additional advisories for extended update support streams, OpenShift Container Platform versions 4.12–4.19, and JBoss Core Services (RHSA-2025:10630, RHSA-2025:10698, RHSA-2025:10699). Slackware, Debian LTS, SUSE, Ubuntu, Oracle Linux, AlmaLinux, Amazon Linux 2, and Mageia have also released updated packages. As a workaround where patching is not immediately possible, restrict XML processing to trusted sources and implement input validation to reject XML documents with excessively long namespace prefixes or local names.

Community reactions

Red Hat rated this vulnerability as "Important" severity and issued a broad set of security advisories covering RHEL 7 through 10, multiple OpenShift Container Platform versions, and JBoss Core Services, reflecting the wide deployment of libxml2 across their product portfolio (Red Hat Bugzilla). CISA published an ICS advisory (ICSA-25-259-02) noting the impact on Hitachi Energy RTU500 industrial control systems, highlighting the vulnerability's reach into OT environments (CISA ICS Advisory). The vulnerability also affected SteamOS 3.7.15, which was patched and noted in gaming community coverage. General community coverage was broad but routine, with no significant controversy or notable researcher commentary beyond standard patch advisories.

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-34191CRITICAL9.1
  • NixOS logoNixOS
  • apr-util
NoYesAug 06, 2026
CVE-2026-32327CRITICAL9.1
  • NixOS logoNixOS
  • apr-util-bdb
NoYesAug 06, 2026
CVE-2026-34502HIGH7.5
  • NixOS logoNixOS
  • apr-util-ldap
NoYesAug 06, 2026
CVE-2026-34501HIGH7.5
  • NixOS logoNixOS
  • apr-util-ldap
NoYesAug 06, 2026
CVE-2025-49506HIGH7.5
  • NixOS logoNixOS
  • apr-util-sqlite
NoYesAug 06, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management