CVE-2026-33116

Uncontrolled Resource Consumption
Improper Input Validation (4.16)
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-33116) has been identified in the EncryptedXml class of the System.Security.Cryptography.Xml component, where a specially crafted XML document drives the decryption transform into a loop that never reaches its exit condition. The traversal keeps rediscovering and re-queuing the same encrypted elements, consuming CPU and memory until the process is killed or becomes unresponsive.

Per CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), the product contains an iteration or loop with an exit condition that cannot be reached, meaning the loop will execute indefinitely.

Per CWE-400: Uncontrolled Resource Consumption, the product does not properly control the allocation and maintenance of a limited resource, enabling an actor to influence the amount consumed and eventually exhaust it.

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.

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, in XmlDecryptionTransform.ProcessElementRecursively. The method drains a work queue of EncryptedData elements, and after decrypting each one it searches the result for further encrypted elements and appends them to the same queue:

XmlNodeList nodes = child.SelectNodes("//enc:EncryptedData", _nsm);
if (nodes.Count > 0)
{
    foreach (XmlNode value in nodes)
    {
        encryptedDatasQueue.Enqueue(value);
    }
}

The XPath expression begins with //, which is document-wide rather than relative to the element just decrypted. Every pass therefore re-selects encrypted elements that have already been processed and enqueues them again. Because the queue tracked no notion of how far a given element was from the document root, and nothing recorded which elements had already been visited, a document structured so that decryption keeps producing matches leaves the queue permanently non-empty. The loop's exit condition — an empty queue — is never reached.

An attacker who can supply an encrypted XML document, a SOAP message, or a signed configuration file to an application that applies the decryption transform can pin a thread at full CPU and grow the queue without bound. Repeating the request across connections denies service to the whole application.

The fixed releases pair every queued element with the depth at which it was found and refuse to descend past a configured limit, throwing a CryptographicException — "The XML element has exceeded the maximum nesting depth allowed for decryption." — when the limit is exceeded. The queue was also given an explicit while (queue.Count > 0) form in place of the earlier sentinel-based loop, so the exit condition is now structural. The depth limit defaults to 64 and is configurable through the AppContext switch System.Security.Cryptography.Xml.DangerousMaxRecursionDepth.

This fix reached NES for .NET as a single backport that also carries CVE-2026-26171 and CVE-2026-32203; 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-33116
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
Uncontrolled Resource Consumption
Improper Input Validation (4.16)
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.