Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-4224

CVE-2026-4224: Expat Parser Buffer Overflow Vulnerability

CVE-2026-4224 is a buffer overflow flaw in Expat parser that triggers a C stack overflow when parsing deeply nested content models in inline DTDs. This article covers technical details, affected versions, and mitigations.

Published: March 20, 2026

CVE-2026-4224 Overview

CVE-2026-4224 is a stack overflow vulnerability in Python's Expat XML parser that occurs when processing deeply nested XML content models. When an Expat parser with a registered ElementDeclHandler parses an inline document type definition (DTD) containing a deeply nested content model, unbounded C recursion in the conv_content_model function leads to a C stack overflow, causing the application to crash.

This vulnerability is classified under CWE-674 (Uncontrolled Recursion), which describes scenarios where excessive recursive calls consume stack memory without proper depth limits, ultimately leading to denial of service conditions.

Critical Impact

Applications using Python's xml.parsers.expat module with ElementDeclHandler registered are vulnerable to denial of service attacks through crafted XML documents containing deeply nested DTD content models.

Affected Products

  • Python CPython (versions using vulnerable pyexpat module)
  • Applications using xml.parsers.expat with ElementDeclHandler
  • Systems parsing untrusted XML with Python's Expat bindings

Discovery Timeline

  • 2026-03-16 - CVE-2026-4224 published to NVD
  • 2026-03-17 - Last updated in NVD database

Technical Details for CVE-2026-4224

Vulnerability Analysis

The vulnerability resides in Python's pyexpat.c module, specifically within the conv_content_model function. This function recursively processes XML content model definitions found in document type declarations. When parsing a maliciously crafted XML document containing an extremely deep nesting of content model elements, the recursive function calls exhaust the C stack before any safeguards can intervene.

The attack is network-accessible, meaning remote attackers can trigger the vulnerability by sending specially crafted XML data to vulnerable applications. While the attack requires some level of privilege (authentication may be needed depending on the application), no user interaction is required for exploitation. The primary impact is availability—successful exploitation causes a complete crash of the Python interpreter or application process.

Root Cause

The root cause is unbounded C recursion in the conv_content_model function within Modules/pyexpat.c. The function lacked proper recursion depth checking, allowing an attacker-controlled XML structure to dictate how deep the call stack grows. Without explicit limits or iterative processing, deeply nested content models directly translate to equally deep recursive calls, exhausting available stack space.

Attack Vector

An attacker can exploit this vulnerability by:

  1. Crafting an XML document with an inline DTD containing a deeply nested content model
  2. Sending this document to a Python application that uses xml.parsers.expat with an ElementDeclHandler registered
  3. When the parser attempts to process the malformed DTD, unbounded recursion occurs
  4. The C stack overflows, crashing the Python process and causing denial of service

The following patch shows the fix that adds recursion depth checking:

c
 #endif
 
 #include "Python.h"
+#include "pycore_ceval.h"         // _Py_EnterRecursiveCall()
 #include "pycore_import.h"        // _PyImport_SetModule()
 #include "pycore_pyhash.h"        // _Py_HashSecret
 #include "pycore_traceback.h"     // _PyTraceback_Add()

Source: GitHub Commit Fix

The patch introduces the _Py_EnterRecursiveCall() mechanism from Python's core evaluation module to properly track and limit recursion depth, preventing uncontrolled stack growth.

Detection Methods for CVE-2026-4224

Indicators of Compromise

  • Application crashes with stack overflow or segmentation fault when processing XML
  • Python interpreter crashes during XML parsing operations
  • Unusual XML documents with extremely deep DTD content model nesting in logs
  • Repeated denial of service incidents affecting XML processing components

Detection Strategies

  • Monitor for Python process crashes associated with XML parsing modules
  • Implement logging around xml.parsers.expat parser initialization with ElementDeclHandler
  • Analyze incoming XML traffic for anomalously deep DTD content model structures
  • Deploy application-level monitoring for unexpected parser terminations

Monitoring Recommendations

  • Enable crash reporting and stack trace collection for Python applications
  • Monitor system logs for segmentation faults in Python processes handling XML
  • Implement rate limiting on XML submission endpoints
  • Track resource consumption patterns during XML processing operations

How to Mitigate CVE-2026-4224

Immediate Actions Required

  • Update Python to a patched version that includes the recursion depth fix
  • Review applications using xml.parsers.expat with ElementDeclHandler for exposure
  • Consider disabling ElementDeclHandler if DTD content model parsing is not required
  • Implement input validation to reject XML with excessively complex DTDs

Patch Information

Python has released security patches addressing this vulnerability across multiple branches. The fix adds proper recursion depth checking using _Py_EnterRecursiveCall() in the conv_content_model function. Patches are available for Python 3.13, 3.14, and the main development branch:

  • Python 3.13 Patch
  • Python 3.14 Patch
  • Main Branch Patch

Additional details are available in the Python Security Announcement and the GitHub Issue Discussion.

Workarounds

  • Avoid using ElementDeclHandler when parsing untrusted XML content
  • Pre-process XML to reject documents with inline DTDs before Expat parsing
  • Implement XML schema validation that limits DTD complexity
  • Use alternative XML parsing libraries that have built-in recursion limits
bash
# Verify Python version and check for vulnerability
python3 --version
# Update Python to patched version
# For systems using package managers:
sudo apt update && sudo apt upgrade python3
# Or using pyenv:
pyenv install 3.13.x  # Replace with patched version
pyenv global 3.13.x

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechN/A

  • SeverityMEDIUM

  • CVSS Score6.0

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-674
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Fix

  • GitHub Commit Change

  • GitHub Issue Discussion

  • GitHub Pull Request

  • Python Security Announcement

  • OpenWall OSS-Security Thread
  • Latest CVEs
  • CVE-2025-49454: TinySalt Path Traversal Vulnerability

  • CVE-2025-48261: MultiVendorX Information Disclosure Flaw

  • CVE-2025-32119: CardGate WooCommerce SQL Injection Flaw

  • CVE-2025-26879: s2Member Plugin Reflected XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English