# CVE-2025-6021: Libxml2: integer overflow in xmlbuildqname() leads to stack buffer overflow in libxml2

> Integer overflow in libxml2's xmlBuildQName function causes stack buffer overflow, allowing attackers to execute code or crash applications via crafted input.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Jun 2025
- **Updated:** 12 Oct 2026
- **Also known as:** ALPINE-CVE-2025-6021, AZL-64101, AZL-64124, BELL-CVE-2025-6021, BIT-java-2025-6021, BIT-java-min-2025-6021, BIT-jre-2025-6021, CLSA-2025-1752747463, CLSA-2025-1757015069, CLSA-2025-1757015164, CLSA-2025-1757522880, CLSA-2025-1759332050, CLSA-2025-1759336759, DEBIAN-CVE-2025-6021, ECHO-48b5-0c84-55da, GHSA-32vr-5hxf-x93f, JLSEC-2025-196, MINI-cfgm-mrw2-qcq3, OESA-2025-1701, OESA-2025-1702, OESA-2025-1703, OESA-2025-1704, OESA-2025-1716, UBUNTU-CVE-2025-6021

## What is CVE-2025-6021?

CVE-2025-6021 is a high-severity vulnerability in Redhat Enterprise Linux, published on 12 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A flaw was found in libxml2's xmlBuildQName function, where integer overflows in buffer size calculations can lead to a stack-based buffer overflow. This issue can result in memory corruption or a denial of service when processing crafted input.

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2025-6021?

3 open source packages ship an affected version, including java, java-min and jre. It affects 20 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `java` | Bitnami | All versions | 1.8.0, 8.0.481 |
| `java-min` | Bitnami | All versions | 1.8.0, 8.0.481 |
| `jre` | Bitnami | All versions | 1.8.0, 8.0.481 |

Products: Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Arm 64, Redhat Enterprise Linux for Arm 64 Eus, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Ibm Z Systems Eus, Redhat Enterprise Linux for Power Little Endian, Redhat Enterprise Linux for Power Little Endian Eus, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server for Power Little Endian Update Services for Sap Solutions, Redhat Enterprise Linux Server Tus, Redhat In-Vehicle Operating System, Redhat Jboss Core Services, Redhat Openshift Container Platform, Redhat Openshift Container Platform for Arm64, Redhat Openshift Container Platform for Ibm Z, Redhat Openshift Container Platform for Linuxone, Redhat Openshift Container Platform for Power, Xmlsoft Libxml2.

## How do I fix CVE-2025-6021?

Upgrade java to a fixed version for your release line: 1.8.0 or 8.0.481.

## Is CVE-2025-6021 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-6021 exists.

## Other vulnerabilities in Redhat Enterprise Linux

- [CVE-2018-14667](https://insights.sbomify.com/CVE-2018-14667/): Red Hat JBoss RichFaces Framework Expression Language Injection (critical 9.8, exploited in the wild)
- [CVE-2021-20325](https://insights.sbomify.com/CVE-2021-20325/): Missing fixes for CVE-2021-40438 and CVE-2021-26691 in the versions of httpd, as shipped in Red Hat Enterprise Linux 8.5.0, causes a securit (critical 9.8)
- [CVE-2018-25011](https://insights.sbomify.com/CVE-2018-25011/): Memory corruption in libwebp (critical 9.8)
- [CVE-2018-25014](https://insights.sbomify.com/CVE-2018-25014/): Other in libwebp (critical 9.8)
- [CVE-2014-3585](https://insights.sbomify.com/CVE-2014-3585/): Supply chain in redhat-upgrade-tool (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-6021 and fix it if it is affected.

What it is: CVE-2025-6021 is a high-severity vulnerability in Redhat Enterprise Linux, published on 12 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-6021 exists.

Affected packages and fixed versions:
- java (Bitnami): affected all versions; fixed in 1.8.0, 8.0.481
- java-min (Bitnami): affected all versions; fixed in 1.8.0, 8.0.481
- jre (Bitnami): affected all versions; fixed in 1.8.0, 8.0.481

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-6021/ (Markdown: https://insights.sbomify.com/CVE-2025-6021/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-6021
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-6021
- OSV: https://osv.dev/vulnerability/CVE-2025-6021

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-6021/
Summaries are generated and may contain mistakes; the official description above is the record.
