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

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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.