# CVE-2026-4224: Stack overflow parsing XML with deeply nested DTD content models

> A stack overflow in the Expat parser within CPython can cause a denial of service when processing deeply nested XML DTD content models with a registered handler.

- **Severity:** Medium 6.0 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Mar 2026
- **Updated:** 13 Aug 2026
- **Also known as:** ALPINE-CVE-2026-4224, AZL-109707, AZL-80046, BELL-CVE-2026-4224, BIT-libpython-2026-4224, BIT-python-2026-4224, BIT-python-min-2026-4224, CLSA-2026-1782979631, CLSA-2026-1782979680, CLSA-2026-1782983048, DEBIAN-CVE-2026-4224, ECHO-7dc2-599b-22cd, GHSA-h46w-ffvp-4pw5, MINI-53h7-9mwx-5cvh, MINI-57m4-ch2q-7q76, MINI-c4g9-p3xf-8gpq, MINI-g56x-qqhr-j2wr, MINI-vmcj-5q2w-f625, PSF-2026-12, ROOT-OS-ALPINE-320-CVE-2026-4224, UBUNTU-CVE-2026-4224

## What is CVE-2026-4224?

CVE-2026-4224 is a medium-severity denial of service vulnerability in Python Python, published on 16 Mar 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

When an Expat parser with a registered ElementDeclHandler parses an inline
document type definition containing a deeply nested content model a C stack
overflow occurs.

Weakness: CWE-674 (Uncontrolled Recursion)

## Which versions are affected by CVE-2026-4224?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4 |
| `python` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4 |
| `python-min` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4 |

Products: Python Python.

## How do I fix CVE-2026-4224?

Upgrade libpython to a fixed version for your release line: 3.10.21, 3.11.16, 3.12.14 or 3.13.13.

## Is CVE-2026-4224 being exploited?

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

## Other vulnerabilities in Python Python

- [CVE-2008-5031](https://insights.sbomify.com/CVE-2008-5031/): Integer overflow in n/a (critical 10.0)
- [CVE-2014-4650](https://insights.sbomify.com/CVE-2014-4650/): Path traversal in n/a (critical 9.8)
- [CVE-2016-5636](https://insights.sbomify.com/CVE-2016-5636/): Integer overflow in n/a (critical 9.8)
- [CVE-2007-4559](https://insights.sbomify.com/CVE-2007-4559/): Path traversal in n/a (critical 9.8)
- [CVE-2017-17522](https://insights.sbomify.com/CVE-2017-17522/): Command injection in n/a (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-4224 and fix it if it is affected.

What it is: CVE-2026-4224 is a medium-severity denial of service vulnerability in Python Python, published on 16 Mar 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-4224 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4
- python (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4
- python-min (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4

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

## Sources

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

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