# CVE-2025-9714: Stack overflow in libxml2

> A local attacker can cause a stack overflow and denial of service in libxml2 by providing crafted XPath expressions that trigger uncontrolled recursion.

- **Severity:** Medium 6.2 (`CVSS:3.1/AV:L/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:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Sep 2025
- **Updated:** 12 May 2026
- **Also known as:** ALSA-2025:22376, ALSA-2026:11349, CLSA-2025-1759411642, CLSA-2025-1760020147, CLSA-2025-1760020311, CLSA-2025-1760020498, CLSA-2025-1761312327, CLSA-2026-1767608985, CLSA-2026-1768943030, CLSA-2026-1790241783, CLSA-2026-1790242021, CLSA-2026-1790242323, DEBIAN-CVE-2025-9714, DLA-4319-1, ECHO-8406-e671-1093, GHSA-fmj5-rvmp-845r, JLSEC-2025-91, OESA-2025-2255, OESA-2025-2285, RHSA-2025:22162, RHSA-2025:22163, RHSA-2025:22177, RHSA-2025:22376, RHSA-2025:22377, RHSA-2026:11349, RHSA-2026:14832, RHSA-2026:14858, RHSA-2026:15967, RHSA-2026:22420, RLSA-2025:22376, RLSA-2026:11349, UBUNTU-CVE-2025-9714, USN-7743-1

## What is CVE-2025-9714?

CVE-2025-9714 is a medium-severity denial of service vulnerability in Xmlsoft Libxml2, published on 10 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Uncontrolled recursion in XPath evaluation in libxml2 up to and including version 2.9.14 allows a local attacker to cause a stack overflow via crafted expressions. XPath processing functions `xmlXPathRunEval`, `xmlXPathCtxtCompile`, and `xmlXPathEvalExpr` were resetting recursion depth to zero before making potentially recursive calls. When such functions were called recursively this could allow for uncontrolled recursion and lead to a stack overflow. These functions now preserve recursion depth across recursive calls, allowing recursion depth to be controlled.

Weakness: CWE-674 (Uncontrolled Recursion)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libxml2` | AlmaLinux:8 | All versions | 2.9.7-21.el8_10.4 |
| `libxml2-devel` | AlmaLinux:8 | All versions | 2.9.7-21.el8_10.4 |
| `python3-libxml2` | AlmaLinux:8 | All versions | 2.9.7-21.el8_10.4 |
| `libxml2` | AlmaLinux:9 | All versions | 2.9.13-14.el9_7 |
| `libxml2-devel` | AlmaLinux:9 | All versions | 2.9.13-14.el9_7 |
| `python3-libxml2` | AlmaLinux:9 | All versions | 2.9.13-14.el9_7 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-21.el8_10.4 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-21.el8_10.4 |
| `libxml2-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-21.el8_10.4 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.7-21.el8_10.4 |
| `libxml2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-21.el8_10.4 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-21.el8_10.4 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-21.el8_10.4 |
| `python3-libxml2` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-21.el8_10.4 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.9.7-21.el8_10.4 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-14.el9_7 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-14.el9_7 |
| `libxml2-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-14.el9_7 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.13-14.el9_7 |
| `libxml2` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-14.el9_7 |
| `libxml2-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-14.el9_7 |
| `libxml2-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-14.el9_7 |
| `python3-libxml2` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-14.el9_7 |
| `python3-libxml2-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:2.9.13-14.el9_7 |
| `libxml2-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.7-9.el8_4.9 |
| `libxml2-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.7-9.el8_4.9 |
| `libxml2-devel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.7-9.el8_4.9 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.7-9.el8_4.9 |
| `libxml2` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:2.9.7-9.el8_4.9 |
| `libxml2-debuginfo` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:2.9.7-9.el8_4.9 |
| `libxml2-debugsource` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:2.9.7-9.el8_4.9 |
| `python3-libxml2` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:2.9.7-9.el8_4.9 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:2.9.7-9.el8_4.9 |
| `libxml2-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.13 |
| `libxml2-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.13 |
| `libxml2-devel` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.13 |
| `python3-libxml2-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.7-13.el8_6.13 |
| `libxml2` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.13 |
| `libxml2-debuginfo` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.13 |
| `libxml2-debugsource` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.9.7-13.el8_6.13 |

Products: Xmlsoft Libxml2.

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

Apply the vendor's patch.

## Is CVE-2025-9714 being exploited?

There is no known exploitation of CVE-2025-9714 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-2025-9714 and fix it if it is affected.

What it is: CVE-2025-9714 is a medium-severity denial of service vulnerability in Xmlsoft Libxml2, published on 10 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-9714 in the wild and no public exploit code.

Affected product: Xmlsoft Libxml2. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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