Junglewise Threat Intelligence

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

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

Technologies: Python Software Foundation CPython. Vendors: Python Software Foundation.

Executive brief

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.

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