CVE-2026-32203

Improper Input Validation (4.16)
Stack-based Buffer Overflow
Affects
.NET
in
.NET
No items found.
Versions
System.Security.Cryptography.Xml >= 6.0.0 <= 6.0.2
Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

.NET is a free, open-source, cross-platform framework for building modern apps and powerful cloud services. It consists of a runtime and a developer platform made up of tools, programming languages, and libraries for building many different types of applications.

A denial-of-service vulnerability (CVE-2026-32203) has been identified in the EncryptedXml class of the System.Security.Cryptography.Xml component, where processing a specially crafted XML document drives recursion that is bounded only by the nesting depth of the attacker's input. Each level of nesting consumes a stack frame, so a sufficiently deep document exhausts the thread stack and terminates the process.

Per CWE-121: Stack-based Buffer Overflow, a Stack-based Buffer Overflow is a buffer overflow condition where the buffer being overwritten is allocated on the stack.

Per CWE-20: Improper Input Validation, Improper Input Validation is when the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.

Per CWE-787: Out-of-bounds Write, the product writes data past the end, or before the beginning, of the intended buffer.

This issue affects .NET 6. On .NET 6, System.Security.Cryptography.Xml is absent from the base Microsoft.NETCore.App runtime but ships in-box in both the Microsoft.AspNetCore.App and Microsoft.WindowsDesktop.App shared frameworks, so ASP.NET Core and WPF applications carry the affected assembly without any explicit package reference; console applications on the base runtime carry it only if they reference the NuGet package directly. In all cases an application is exposed only if it uses the EncryptedXml or SignedXml APIs to decrypt or verify XML it does not control. Microsoft also serviced supported .NET releases in its April 2026 security updates for .NET 8.0, .NET 9.0, and .NET 10.0.

Details

Module Info

Vulnerability Info

This High-severity vulnerability is found in the System.Security.Cryptography.Xml package as shipped for .NET 6.0. Two code paths recursed once per level of XML nesting with no depth limit of any kind.

The first is canonicalization. CanonicalizationDispatcher.Write and CanonicalizationDispatcher.WriteHash walk a node tree, dispatching each node back through themselves, so the recursion depth equals the nesting depth of the document being canonicalized:

public static void Write(XmlNode node, StringBuilder strBuilder, DocPosition docPos, AncestralNamespaceContextManager anc)
{
    if (node is ICanonicalizableNode)
        ((ICanonicalizableNode)node).Write(strBuilder, docPos, anc);
    else
        WriteGenericNode(node, strBuilder, docPos, anc);   // recurses per child
}

The second is key resolution. EncryptedXml.DecryptEncryptedKey resolves a nested EncryptedKey by calling itself, so a chain of nested key elements recurses once per link.

An attacker who can supply an encrypted XML document, a signed SOAP message, or a signed configuration file to an application that decrypts or verifies it can nest elements deeply enough to exhaust the thread stack. Stack exhaustion in .NET raises a StackOverflowException, which cannot be caught and always terminates the process, so a single malicious document takes the application down with no opportunity to recover.

The fixed releases track nesting depth and fail closed. Canonicalization carries a thread-static depth counter, key resolution reuses the existing _xmlDsigSearchDepthCounter, and either path throws a CryptographicException — "The XML element has exceeded the maximum nesting depth allowed for decryption." — once the limit is passed. The limit defaults to 64 and is configurable through the AppContext switch System.Security.Cryptography.Xml.DangerousMaxRecursionDepth, which exists as a compatibility escape hatch for consumers that legitimately process deeply nested documents.

This fix reached NES for .NET as a single backport that also carries CVE-2026-26171 and CVE-2026-33116; upstream shipped all three as one mitigation set in System.Security.Cryptography.Xml 8.0.3.

Mitigation

.NET 6 is End-of-Life and will not receive any updates to address this issue. For more information see .NET and .NET Core official support policy.

Users of the affected components should apply one of the following mitigations:

  • Upgrade affected applications to one of:
    • System.Security.Cryptography.Xml >= 8.0.3
    • System.Security.Cryptography.Xml >= 9.0.15
    • System.Security.Cryptography.Xml >= 10.0.6
  • Leverage a commercial support partner like HeroDevs for post-EOL security support, including NES for .NET 6.0.40 or later.
  • How the fix reaches an application depends on how it consumes the assembly:
    • Framework-dependent applications receive the fix by installing the patched NES shared framework (Microsoft.AspNetCore.App or Microsoft.WindowsDesktop.App). No rebuild is required.
    • Self-contained and single-file applications embed their own copy of System.Security.Cryptography.Xml and do not pick up a shared-framework update. These must be rebuilt against the patched NES packages and redeployed.
    • Applications with an explicit PackageReference to System.Security.Cryptography.Xml must update that reference to the NES build and rebuild.

Credits

Microsoft credits Ludvig Pedersen for reporting this vulnerability.

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-32203
PROJECT Affected
.NET
Versions Affected
System.Security.Cryptography.Xml >= 6.0.0 <= 6.0.2
NES Versions Affected
Published date
August 10, 2026
≈ Fix date
April 14, 2026
Fixed in
Category
Improper Input Validation (4.16)
Stack-based Buffer Overflow
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for .NET
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.