# CVE-2024-25062: Use after free in n/a

> Attackers can trigger a use-after-free in libxml2 via crafted XML when DTD validation and XInclude are enabled, potentially causing crashes or code execution.

- **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:** 4 Feb 2024
- **Updated:** 15 Oct 2026
- **Also known as:** ALPINE-CVE-2024-25062, ALSA-2024:2679, ALSA-2024:3626, AZL-34290, AZL-34961, BELL-CVE-2024-25062, BIT-java-2024-25062, BIT-java-min-2024-25062, BIT-jre-2024-25062, CLSA-2024-1708416911, CLSA-2024-1708426314, CLSA-2024-1708426517, CLSA-2024-1708427636, CLSA-2024-1708427829, CLSA-2024-1708639015, CLSA-2024-1708639232, CLSA-2024-1718029281, DEBIAN-CVE-2024-25062, ECHO-3385-dec3-86a0, GHSA-x77r-6xxm-wjmx, JLSEC-2025-83, MGASA-2024-0172, MINI-56j7-qwf3-8q64, OESA-2024-1183, RHSA-2024:2679, RHSA-2024:3299, RHSA-2024:3303, RHSA-2024:3625, RHSA-2024:3626, RLSA-2024:2679, RLSA-2024:3626, SUSE-SU-2024:0461-1, SUSE-SU-2024:0461-2, SUSE-SU-2024:0555-1, SUSE-SU-2024:0556-1, SUSE-SU-2024:0613-1, SUSE-SU-2024:0613-2, UBUNTU-CVE-2024-25062, USN-6658-1, USN-6658-2, openSUSE-SU-2024:13676-1

## What is CVE-2024-25062?

CVE-2024-25062 is a high-severity use after free vulnerability in Xmlsoft Libxml2, published on 4 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

An issue was discovered in libxml2 before 2.11.7 and 2.12.x before 2.12.5. When using the XML Reader interface with DTD validation and XInclude expansion enabled, processing crafted XML documents can lead to an xmlValidatePopElement use-after-free.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2024-25062?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `java` | Bitnami | All versions | 1.8.0, 8.0.431 |
| `java-min` | Bitnami | All versions | 1.8.0, 8.0.431 |
| `jre` | Bitnami | All versions | 1.8.0, 8.0.431 |
| `libxml2` | AlmaLinux:8 | All versions | 2.9.7-18.el8_10.1 |
| `libxml2-devel` | AlmaLinux:8 | All versions | 2.9.7-18.el8_10.1 |
| `python3-libxml2` | AlmaLinux:8 | All versions | 2.9.7-18.el8_10.1 |
| `libxml2` | AlmaLinux:9 | All versions | 2.9.13-6.el9_4 |
| `libxml2-devel` | AlmaLinux:9 | All versions | 2.9.13-6.el9_4 |
| `python3-libxml2` | AlmaLinux:9 | All versions | 2.9.13-6.el9_4 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.1 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.1 |
| `libxml2-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.1 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-18.el8_10.1 |
| `libxml2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.1 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.1 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.1 |
| `python3-libxml2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.1 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-18.el8_10.1 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_4 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_4 |
| `libxml2-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_4 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-6.el9_4 |
| `libxml2` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_4 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_4 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_4 |
| `python3-libxml2` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_4 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-6.el9_4 |
| `libxml2-debuginfo` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.5 |
| `libxml2-debugsource` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.5 |
| `libxml2-devel` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.5 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.5 |
| `libxml2` | Red Hat:rhel_eus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.5 |
| `libxml2-debuginfo` | Red Hat:rhel_eus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.5 |
| `libxml2-debugsource` | Red Hat:rhel_eus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.5 |
| `python3-libxml2` | Red Hat:rhel_eus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.5 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_eus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.5 |
| `libxml2-debuginfo` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:2.9.7-16.el8_8.4 |
| `libxml2-debugsource` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:2.9.7-16.el8_8.4 |
| `libxml2-devel` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:2.9.7-16.el8_8.4 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:2.9.7-16.el8_8.4 |

Products: Xmlsoft Libxml2.

## How do I fix CVE-2024-25062?

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

## Is CVE-2024-25062 being exploited?

There is no known exploitation of CVE-2024-25062 in the wild and no public exploit code.

## Other vulnerabilities in Xmlsoft Libxml2

- [CVE-2017-16931](https://insights.sbomify.com/CVE-2017-16931/): XML external entity in n/a (critical 9.8)
- [CVE-2017-8872](https://insights.sbomify.com/CVE-2017-8872/): Information disclosure in n/a (critical 9.1)
- [CVE-2022-49043](https://insights.sbomify.com/CVE-2022-49043/): Use after free in libxml2 (high 8.1)
- [CVE-2026-86140](https://insights.sbomify.com/CVE-2026-86140/): Memory corruption in libxml2 (high 8.0)
- [CVE-2024-34459](https://insights.sbomify.com/CVE-2024-34459/): Memory corruption in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-25062 and fix it if it is affected.

What it is: CVE-2024-25062 is a high-severity use after free vulnerability in Xmlsoft Libxml2, published on 4 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-25062 in the wild and no public exploit code.

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

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-2024-25062/ (Markdown: https://insights.sbomify.com/CVE-2024-25062/index.md)
```

## Sources

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

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