# CVE-2026-4224: Python pyexpat stack overflow in conv_content_model

Source: https://junglewise.ai/threats/cve-2026-4224-python-pyexpat-stack-overflow-in-conv-content-model  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-16. Updated: 2026-06-04  
License: CC BY 4.0 with a link back

CVE-2026-4224 · Severity: high · CVSS 7.5 · Published 2026-03-16

A vulnerability in Python's XML parsing library (pyexpat) can allow an attacker to crash an application by providing a specially crafted XML file. This occurs when the parser processes a document with deeply nested definitions, leading to a system memory error. This could result in a denial-of-service, impacting the availability of services that process untrusted XML data.

## Quick answers

**Is CVE-2026-4224 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-4224 being exploited in the wild.

**How severe is CVE-2026-4224?** High severity, with a CVSS score of 7.5, published 16 March 2026.

**Which products and versions are affected?** Python Software Foundation Python < 3.10.0, 3.13.0 to < 3.13.13, 3.14.0 to < 3.14.4, 3.15.0-alpha1 to 3.15.0-alpha7.

**Is there a fix for CVE-2026-4224?** A patch was published on 2026-03-16: Fixes merged into main CPython branches Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-4224 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-4224?** Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A stack overflow vulnerability (CWE-674: Uncontrolled Recursion) exists in the `conv_content_model` function within `pyexpat.c`. When an Expat parser with a registered `ElementDeclHandler` processes an inline Document Type Definition (DTD) containing a deeply nested content model, it triggers unbounded C recursion. An unauthenticated remote attacker can exploit this by providing a malicious XML document, leading to a crash of the Python interpreter. Patches have been released across multiple Python branches (3.10 through 3.15) to limit recursion depth.

## Affected products

- Python Software Foundation Python < 3.10.0, 3.13.0 to < 3.13.13, 3.14.0 to < 3.14.4, 3.15.0-alpha1 to 3.15.0-alpha7

## Timeline

- 2026-03-14: other: Security fix prepared in CPython repository
- 2026-03-16: disclosed: Vulnerability disclosed and CVE assigned
- 2026-03-16: patched: Fixes merged into main CPython branches
- 2026-03-16: advisory: NVD published the advisory

## References

- [https://github.com/python/cpython/commit/196edfb06a7458377d4d0f4b3cd41724c1f3bd4a](https://github.com/python/cpython/commit/196edfb06a7458377d4d0f4b3cd41724c1f3bd4a)
- [https://github.com/python/cpython/commit/642865ddf4b232da1f3b1f7abcfa3254c4bfe785](https://github.com/python/cpython/commit/642865ddf4b232da1f3b1f7abcfa3254c4bfe785)
- [https://github.com/python/cpython/commit/af856a7177326ac25d9f66cc6dd28b554d914fee](https://github.com/python/cpython/commit/af856a7177326ac25d9f66cc6dd28b554d914fee)
- [https://github.com/python/cpython/commit/e0a8a6da90597a924b300debe045cdb4628ee1f3](https://github.com/python/cpython/commit/e0a8a6da90597a924b300debe045cdb4628ee1f3)
- [https://github.com/python/cpython/commit/eb0e8be3a7e11b87d198a2c3af1ed0eccf532768](https://github.com/python/cpython/commit/eb0e8be3a7e11b87d198a2c3af1ed0eccf532768)
- [https://github.com/python/cpython/issues/145986](https://github.com/python/cpython/issues/145986)
- [https://github.com/python/cpython/pull/145987](https://github.com/python/cpython/pull/145987)
