CVE-2026-4224
Rocky Linux vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Exploitation steps

  1. Identify a target: Find an application or service that uses Python's 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.
  2. Craft a malicious XML document: Construct an XML document with an inline DTD containing an extremely deeply nested content model. For example, generate a DTD with ~500,000 levels of nesting using a pattern such as <!DOCTYPE root [ <!ELEMENT root (a)> <!ELEMENT a (b)> ... ]> where each element references the next.
  3. Submit the payload: Send the crafted XML document to the target application's XML parsing endpoint (e.g., via HTTP POST, file upload, API call, or any other input vector).
  4. Trigger the crash: The Expat parser invokes 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).

Indicators of compromise

  • Logs: Unexpected Python interpreter crashes (segmentation faults or core dumps) in application logs coinciding with XML parsing operations; error messages referencing pyexpat or xml.parsers.expat.
  • Process: Abrupt termination of Python worker processes without a clean Python traceback; repeated process restarts by a supervisor (e.g., systemd, gunicorn, uWSGI) after XML input is received.
  • Network: Unusually large or structurally anomalous XML payloads submitted to application endpoints, particularly those with deeply nested or repetitive DTD declarations in the document preamble.
  • File System: Core dump files generated in the application working directory following crashes during XML parsing operations.

Mitigation and workarounds

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).

Community reactions

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).

Additional resources


SourceThis report was generated using AI

Related Rocky Linux vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-64600HIGH7.8
  • Linux Kernel logoLinux Kernel
  • kernel-debug
NoYesJul 23, 2026
CVE-2026-47063HIGH7.5
  • Amazon Corretto JDK logoAmazon Corretto JDK
  • java-17-openjdk-jmods
NoYesJul 21, 2026
CVE-2026-60147MEDIUM6.5
  • Amazon Corretto JDK logoAmazon Corretto JDK
  • java-1.8.0-openjdk-demo
NoYesJul 21, 2026
CVE-2026-47059LOW3.7
  • Amazon Corretto JDK logoAmazon Corretto JDK
  • java-11-amazon-corretto
NoYesJul 21, 2026
CVE-2026-14957NONEN/A
  • Rocky Linux logoRocky Linux
  • libreswan
NoYesJul 27, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management