
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-4224 is a denial-of-service vulnerability in Python's xml.parsers.expat module (CPython's pyexpat.c) caused by unbounded C stack recursion in the conv_content_model function. When an Expat parser with a registered ElementDeclHandler processes an inline Document Type Definition (DTD) containing a deeply nested content model, the recursive function exhausts the C stack and causes a hard interpreter crash. Affected versions include CPython 3.10.x through 3.13.x (before 3.13.13), 3.14.x (before 3.14.4), and 3.15.0 alpha releases (alpha1–alpha7). The vulnerability was disclosed on March 16, 2026, and carries a CVSS v3.1 base score of 7.5 (High) and a CVSS v4.0 base score of 6.0 (Medium) (Red Hat Advisory, CPython Issue).
The root cause is uncontrolled recursion (CWE-674) in the conv_content_model() function within Modules/pyexpat.c. This function recursively traverses the tree structure of an XML content model parsed from an inline DTD; without any recursion depth guard, a sufficiently deeply nested DTD content model (e.g., 500,000 levels) causes the C call stack to overflow, crashing the Python interpreter. The fix adds calls to _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() at the entry and exit of conv_content_model, converting the hard crash into a Python RecursionError. No authentication or user interaction is required — an attacker only needs to supply a malformed XML document to any code path that creates an Expat parser with an ElementDeclHandler registered (CPython Commit, CPython PR).
Successful exploitation results in a hard crash of the Python interpreter process, causing a complete denial of service for any application relying on the affected XML parsing functionality. There is no confidentiality or integrity impact — the vulnerability is purely an availability issue. Applications that parse untrusted XML input using Python's xml.parsers.expat with an ElementDeclHandler are at risk, including web services, data pipelines, and any software accepting user-supplied XML documents (Red Hat Advisory, CPython Issue).
xml.parsers.expat module (or any higher-level XML library backed by it) with an ElementDeclHandler registered, and that accepts XML input from untrusted sources.<!DOCTYPE root [ <!ELEMENT root (a)> <!ELEMENT a (b)> ... ]> where each element references the next.conv_content_model recursively for each level of nesting; without a recursion guard, the C stack overflows and the Python interpreter process crashes, resulting in denial of service (CPython Commit, CPython Issue).pyexpat or xml.parsers.expat.Upgrade CPython to a patched version: 3.10.x (backport applied April 8, 2026), 3.11.x (backport applied April 8, 2026), 3.12.x, 3.13.13 or later, or 3.14.4 or later. Python 3.9 and earlier are EOL and will not receive a patch. As a workaround where immediate patching is not feasible, avoid registering ElementDeclHandler on Expat parsers that process untrusted XML input, or implement input validation to reject XML documents with excessively nested DTD structures before they reach the parser. Vendor patches are also available via Red Hat (RHSA-2026:10950, RHSA-2026:19064, RHSA-2026:19177, RHSA-2026:21275), Amazon Linux, openSUSE, Debian LTS, and Microsoft CBL-Mariner (CPython PR, Red Hat Advisory, Microsoft MSRC).
The vulnerability was reported by Stan Ulbrych (StanFromIreland) and patched collaboratively with Bénédikt Tran (picnixz) in the CPython repository within one day of the issue being filed. The fix was backported to all supported Python branches (3.10–3.14). Community discussion on the CPython issue tracker noted that Python 3.9 would not receive a backport as it is end-of-life. The vulnerability received coverage from Linux distribution security teams (Red Hat, openSUSE, Debian, Amazon Linux, Fedora) and was tracked by vulnerability intelligence platforms including Tenable Nessus and Qualys (CPython Issue, oss-sec).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."