CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-32203
7.50.14%

CVE-2026-32203: Stack-based Buffer Overflow in .NET Cryptography XML Processing

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 17, 2026·6 min read·11 visits

No Known Exploit

Executive Summary (TL;DR)

Unbounded recursion in .NET's XML cryptography processing allows remote attackers to trigger a stack overflow and subsequent Denial of Service by supplying deeply nested XML elements.

Microsoft .NET and Visual Studio contain a stack-based buffer overflow vulnerability within the System.Security.Cryptography.Xml library. The flaw occurs due to unbounded recursion when processing deeply nested XML-based cryptographic structures, allowing unauthenticated attackers to cause a Denial of Service (DoS) via process exhaustion.

Vulnerability Overview

CVE-2026-32203 is a critical Denial of Service (DoS) vulnerability impacting the System.Security.Cryptography.Xml library in Microsoft .NET and Visual Studio. The vulnerability manifests as a Stack-based Buffer Overflow (CWE-121) triggered by Improper Input Validation (CWE-20). The affected component handles cryptographic operations on XML structures, specifically focusing on canonicalization (C14N) and the parsing of encrypted elements.

The attack surface exposes any .NET application that processes untrusted XML payloads containing cryptographic structures. Public-facing web services, API endpoints parsing SOAP messages, and applications validating XML signatures are at the highest risk. An unauthenticated remote attacker exploits this vulnerability by sending a maliciously crafted XML document to the targeted service.

The core issue resides in the recursive nature of the XML parsing logic. The library recursively evaluates child nodes without enforcing a maximum depth threshold. This architectural oversight allows an attacker to dictate the execution flow's call stack depth, ultimately exhausting the thread's allocated stack memory and terminating the host process.

Root Cause Analysis

The root cause of CVE-2026-32203 lies in the absence of recursion depth limits within the .NET runtime's handling of specific XML cryptography namespaces. When an application attempts to decrypt or verify a signature containing <EncryptedData> or <EncryptedKey> elements, the System.Security.Cryptography.Xml library invokes the LoadXml method. This method acts as an entry point for parsing the internal structure of the encrypted element.

During processing, the LoadXml method recursively calls itself or related dispatcher methods to evaluate child nodes such as KeyInfo, EncryptionMethod, and CipherData. If an XML payload contains a continuous chain of nested <EncryptedData> elements, the recursion continues unimpeded. Each recursive call consumes additional stack frames. The standard thread stack size in .NET applications is finite, typically bounded at 1.5MB to 8MB depending on the environment and architecture.

When the recursion depth exceeds the available thread stack, the operating system raises a stack overflow exception. Unlike standard managed exceptions in .NET, a StackOverflowException cannot be caught or handled by the application code under default configurations. The .NET runtime immediately terminates the process to prevent memory corruption, directly fulfilling the Denial of Service objective.

The logical flow of the vulnerability is mapped below:

Code Analysis

An analysis of the patch implemented in the .NET runtime (Commit b234b9ae5980f21c499ae0702b098d9898ec786f) reveals the specific mechanisms introduced to restrict unbounded recursion. The remediation focuses on tracking the call stack depth and enforcing a hard limit during the evaluation of XML cryptography elements.

The fix introduces a thread-local variable to maintain the current depth context without introducing synchronization overhead. The developers added a [ThreadStatic] integer variable named t_depth to the CanonicalizationDispatcher, EncryptedData, and EncryptedKey classes. Each recursive entry point increments this counter and decrements it upon returning.

// Conceptual representation of the patched logic in LoadXml
[ThreadStatic]
private static int t_depth;
 
public void LoadXml(XmlElement value)
{
    try 
    {
        t_depth++;
        if (t_depth > System.Security.Cryptography.Xml.DangerousMaxRecursionDepth)
        {
            throw new CryptographicException("The XML element has exceeded the maximum nesting depth allowed for decryption.");
        }
        
        // Original parsing logic for KeyInfo, EncryptionMethod, etc.
        ParseChildNodes(value);
    }
    finally 
    {
        t_depth--;
    }
}

The DangerousMaxRecursionDepth is controlled via an AppContext switch and defaults to a value of 64. If an attacker submits an XML structure nested deeper than 64 levels, the logic preemptively aborts the operation. It throws a standard CryptographicException rather than faulting the thread. The application can catch this exception, preserving process availability.

Exploitation

Exploiting CVE-2026-32203 requires minimal prerequisites. The attacker only needs the ability to submit XML data to a .NET application configured to process XML cryptography features. The vulnerability does not require authentication, specific user interactions, or complex memory manipulation techniques typically associated with buffer overflows.

The attack methodology involves generating a syntactically valid XML document containing deeply nested tags associated with the http://www.w3.org/2001/04/xmlenc# namespace. The payload structure typically consists of thousands of nested <EncryptedData> elements. The attacker submits this payload via standard attack vectors, such as HTTP POST requests targeting SOAP APIs, or file upload functionalities accepting signed XML documents.

Upon receiving the request, the victim service begins parsing the document. Because the XML parser consumes the data synchronously, the parsing thread enters the recursive loop immediately. The stack limits are exhausted within milliseconds, causing an uncatchable exception. The process terminates abruptly, dropping all active connections and terminating service availability until the process restarts.

Impact Assessment

The direct impact of CVE-2026-32203 is a complete loss of availability for the targeted service. The StackOverflowException terminates the hosting process, which halts all current operations. For applications handling high transaction volumes or managing persistent state, this sudden termination induces significant disruption and potential data inconsistency for in-flight transactions.

While the vulnerability is categorized as a Stack-based Buffer Overflow (CWE-121), the runtime environment mitigates the potential for Remote Code Execution (RCE). The .NET framework handles stack overflow conditions by forcefully terminating the process before the attacker can overwrite return addresses or hijack the execution flow. Therefore, the confidentiality and integrity of the system remain intact.

The vulnerability carries a CVSS 3.1 Base Score of 7.5, reflecting its high availability impact, lack of required privileges, and low attack complexity. The Exploit Prediction Scoring System (EPSS) score remains low at 0.00139 (34.04th percentile), indicating a lower statistical likelihood of imminent active exploitation compared to higher-profile remote code execution flaws. The issue is currently absent from the CISA Known Exploited Vulnerabilities (KEV) catalog.

Remediation

The primary remediation strategy requires upgrading the affected .NET framework and Visual Studio installations to their respective patched versions. Microsoft resolved the vulnerability in .NET 10.0.6, .NET 9.0.15, and .NET 8.0.26. Visual Studio users must upgrade to version 17.12.19 or 17.14.30. Organizations should prioritize updating internet-facing applications that parse external XML inputs.

For environments unable to deploy immediate framework updates, administrators can employ external mitigation controls. Web Application Firewalls (WAF) can detect and block malicious payloads by inspecting the depth of XML elements. Security teams should configure WAF rules to reject XML inputs containing unusually deep nesting of http://www.w3.org/2001/04/xmlenc#EncryptedData or EncryptedKey elements. Setting a strict size limit on incoming XML requests also reduces the likelihood of exploitation.

Post-patching, administrators retain the ability to modify the recursion limits if necessary. The patch introduces the System.Security.Cryptography.Xml.DangerousMaxRecursionDepth AppContext switch. While the default limit of 64 is sufficient for nearly all legitimate cryptographic operations, applications requiring deeper nesting can adjust this threshold via application configuration files. Modifying this value is strictly discouraged unless dictated by explicit business requirements.

Official Patches

MicrosoftMicrosoft Security Response Center (MSRC) Advisory
Red HatRed Hat Security Advisory

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:U/RL:O/RC:C
EPSS Probability
0.14%
Top 66% most exploited

Affected Systems

.NET 10.0.NET 9.0.NET 8.0Visual Studio 2022 v17.12Visual Studio 2022 v17.14

Affected Versions Detail

Product
Affected Versions
Fixed Version
Microsoft .NET 10.0
Microsoft
<= 10.0.510.0.6
Microsoft .NET 9.0
Microsoft
<= 9.0.149.0.15
Microsoft .NET 8.0
Microsoft
<= 8.0.258.0.26
Microsoft Visual Studio 2022 v17.12
Microsoft
<= 17.12.1817.12.19
Microsoft Visual Studio 2022 v17.14
Microsoft
<= 17.14.2917.14.30
AttributeDetail
CWE IDCWE-121 / CWE-20
Attack VectorNetwork
CVSS 3.1 Base7.5
EPSS Score0.13%
ImpactDenial of Service (DoS)
Exploit StatusNone / Unproven
CISA KEVNot Listed
Patch StatusAvailable

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-121
Stack-based Buffer Overflow

The vulnerability involves improper validation of recursion depth in XML element processing, leading to stack exhaustion.

Vulnerability Timeline

Vulnerability published and patch released by Microsoft
2026-04-14
Security advisories issued by Red Hat, AWS, and Ubuntu
2026-04-15
Analysis by SANS ISC and Rapid7 confirmed the stack overflow nature of the flaw
2026-04-16

References & Sources

  • [1]Microsoft Security Response Center (MSRC) Advisory
  • [2]Red Hat Advisory
  • [3].NET Runtime Fix Commit
  • [4]CVE.org Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.