Jul 21, 2026·6 min read·5 visits
A Denial of Service vulnerability in Microsoft .NET allows unauthenticated remote attackers to crash applications by submitting XML payloads containing deeply nested cryptographic elements or infinite XSLT loops.
CVE-2026-50525 is a high-severity Denial of Service (DoS) vulnerability in the Microsoft .NET XML Cryptography stack. The vulnerability resides in the `System.Security.Cryptography.Xml` library, specifically within the `EncryptedXml` processing engine. Unauthenticated remote attackers can exploit this flaw by sending specifically crafted XML documents containing nested or recursive structures, or utilizing resource-intensive transforms. Processing such payloads leads to infinite CPU loops, stack exhaustion, or memory starvation, resulting in application termination.
The System.Security.Cryptography.Xml library provides the core implementation for XML encryption, decryption, and digital signatures within the Microsoft .NET ecosystem. This component is commonly deployed in enterprise architectures to process Security Assertion Markup Language (SAML) assertions, WS-Security SOAP headers, and generic encrypted XML files. Because these endpoints are often exposed to untrusted external networks, they present a significant attack surface.
This vulnerability is classified under CWE-770 (Allocation of Resources Without Limits or Throttling). In vulnerable versions of the library, the parsing engine processed incoming XML elements without tracking recursion depths or validating the resource safety of applied cryptographic transforms. Unauthenticated attackers can exploit this lack of control to target application endpoints that automatically handle XML decryption.
The resulting impact is a total loss of application availability. Depending on the vector chosen, the target process will experience 100% thread pool CPU starvation, a process-terminating Out-of-Memory (OOM) exception, or a direct runtime crash via stack overflow.
The vulnerability stems from two independent implementation defects in the XML decryption process. First, during nested parsing and canonicalization processes handled by classes such as CanonicalizationDispatcher, EncryptedData, and EncryptedKey, the library recursively traversed elements without maintaining an explicit depth threshold. If a document contained multiple layers of nested encryption references, the execution stack would grow until a process-terminating StackOverflowException was thrown.
Second, the EncryptedXml engine supported arbitrary transforms defined within <CipherReference> elements. These transforms are applied to retrieve and reconstruct the ciphertext prior to decryption. In affected versions, the engine allowed powerful, highly expressive languages including XML Path Language (XPath) and Extensible Stylesheet Language Transformations (XSLT).
Because the XSLT processor was executed with default permissive configurations, it was susceptible to infinite loop patterns and exponential memory allocation models. Attackers could supply malicious XSLT stylesheets that execute recursive templates indefinitely or define recursively expanding variables. Since the parsing environment lacked resource enforcement thresholds, this directly led to system resource exhaustion.
The security patch introduced in .NET fixes these issues by implementing a thread-static recursion tracking limit and establishing a strict whitelist of safe transform algorithms.
To prevent stack exhaustion, the patch leverages a [ThreadStatic] recursion counter (t_depth) and validates execution depth against LocalAppContextSwitches.DangerousMaxRecursionDepth, which defaults to 64. Below is the patched implementation in CanonicalizationDispatcher.cs:
internal static class CanonicalizationDispatcher
{
+ [ThreadStatic]
+ private static int t_depth;
+
public static void Write(XmlNode node, StringBuilder strBuilder, DocPosition docPos, AncestralNamespaceContextManager anc)
{
- if (node is ICanonicalizableNode)
+ int maxDepth = LocalAppContextSwitches.DangerousMaxRecursionDepth;
+ if (maxDepth > 0 && t_depth > maxDepth)
+ {
+ // Enforce depth validation threshold
+ throw new CryptographicException(SR.Cryptography_Xml_MaxDepthExceeded);
+ }
+
+ t_depth++;
+ try
{
- ((ICanonicalizableNode)node).Write(strBuilder, docPos, anc);
+ if (node is ICanonicalizableNode canonicalizableNode)
+ {
+ canonicalizableNode.Write(strBuilder, docPos, anc);
+ }
+ else
+ {
+ WriteGenericNode(node, strBuilder, docPos, anc);
+ }
}
- else
+ finally
{
- WriteGenericNode(node, strBuilder, docPos, anc);
+ t_depth--;
}
}Additionally, the patch restricts allowed transforms in <CipherReference> elements. The ReferenceUsesSafeTransformMethods helper matches incoming transform algorithms against a hardcoded whitelist (DefaultSafeTransformMethods). Safe algorithms include standard base64 decoding, license transforms, and official canonicalization algorithms (such as C14N). Dangerous transforms like XSLT or XPath are rejected immediately, preventing arbitrary code execution paths in the transformation layer.
An attacker targets this vulnerability by identifying endpoints that accept and process encrypted XML input. The attack does not require prior authentication or session privileges. The exploit payloads are typically delivered as HTTP POST requests containing crafted XML structures.
In an XSLT infinite loop attack, the payload defines a stylesheet inside the <CipherReference> node. This stylesheet contains a template that recursively references itself without a termination condition. When the application receives the payload and invokes EncryptedXml.DecryptDocument(), the execution flow hangs indefinitely on a single CPU thread. By sending multiple identical requests, an attacker can exhaust all threads in the application thread pool, freezing the server.
Alternatively, an attacker can construct an XML expansion attack (similar to the Billion Laughs format) inside the XSLT block. The transform uses nested string concatenations to exponentially expand a baseline string into gigabytes of memory buffer. The resulting allocation instantly triggers an uncatchable OutOfMemoryException, which causes the host operating system to terminate the .NET process.
The exploitation of CVE-2026-50525 leads directly to a Denial of Service. The vulnerability possesses high exploitability due to its low attack complexity and the absence of user interaction or privilege requirements.
The impact is concentrated on system availability. Because .NET process crashes often affect shared application pools (such as IIS Worker Processes or Kestrel host runtimes), a successful attack can disrupt adjacent, healthy services running on the same host.
There is no recorded compromise of confidentiality or integrity associated with this vulnerability. An attacker cannot use this bug to extract data or escalate privileges directly, making the overall impact score 3.6 on the CVSS scale. The National Vulnerability Database assigns a CVSS v3.1 base score of 7.5.
The primary remediation pathway is the installation of updated .NET runtimes and SDK assemblies released by Microsoft. Administrators should upgrade systems to .NET 10.0.6, 9.0.18, or 8.0.29. If using the NuGet dependency model, the System.Security.Cryptography.Xml package must be updated to version 8.0.1 or above.
Temporary workarounds are available for environments where immediate patching is not possible. Security administrators can restrict allowable XML schemas using Web Application Firewall (WAF) deep packet inspection. Rules should be configured to detect and drop incoming payloads containing the XSLT transform identifier (http://www.w3.org/TR/1999/REC-xslt-19991116) or unexpected nested <Transform> blocks.
Additionally, developers can adjust application configuration settings to control the recursion depth limits programmatically using AppContext switches. The System.Security.Cryptography.Xml.DangerousMaxRecursionDepth property can be set to a conservative value, such as 32, within the application's initialization routine to minimize the vulnerability window.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
.NET Microsoft | >= 10.0.0, < 10.0.6 | 10.0.6 |
.NET Microsoft | >= 9.0.0, < 9.0.18 | 9.0.18 |
.NET Microsoft | >= 8.0.0, < 8.0.29 | 8.0.29 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-770 |
| Attack Vector | Network |
| CVSS v3.1 Score | 7.5 (High) |
| Exploit Maturity | Proof of Concept |
| Impact | Denial of Service (DoS) |
| KEV Status | Not Listed |
The software does not restrict, or incorrectly restricts, the allocation of a resource, leading to exhaustion.
A critical security bypass and algorithm downgrade vulnerability in the PostgreSQL JDBC Driver (pgjdbc) allows Man-in-the-Middle (MITM) attackers to silently bypass channel binding requirements. When configured with `channelBinding=require`, the driver fails to assert that the negotiated SCRAM mechanism utilizes channel binding, allowing downgrade to plain SCRAM-SHA-256 when encountering unsupported server certificate signature algorithms (such as Ed25519 or Ed448).
CVE-2026-56170 is a high-severity Remote Denial of Service (DoS) vulnerability in Microsoft's ASP.NET Core framework. The vulnerability spans three separate resource-management vectors within the ASP.NET Core ecosystem, including SignalR Stateful Reconnect allocations, JSON Patch Type Confusion leading to stack exhaustion, and Kestrel HTTP/2 synchronization issues. An unauthenticated remote attacker can exploit these issues to cause process-terminating exceptions, rendering applications unavailable.
The Loofah Ruby gem version 2.25.0 and 2.25.1 contains an incomplete validation vulnerability in its public string-level utility Loofah::HTML5::Scrub.allowed_uri?. This helper fails to detect 'javascript:' URIs that are split by HTML5 named whitespace character references such as 	 and 
. Applications manually invoking this utility to validate links are vulnerable to stored Cross-Site Scripting (XSS), as browsers parse and remove these entities during rendering.
An improper encoding and escaping vulnerability in the .NET SMTP client component allows network-based attackers to perform SMTP command smuggling and email spoofing by injecting control characters into email fields.
CVE-2026-50651 is a high-severity Denial of Service vulnerability in Microsoft .NET runtimes, SDKs, and Visual Studio installations. It stems from a weakness in System.Net.Http (CWE-770), where the HTTP/2 connection handling state machine fails to throttle server-initiated protocol streams and control frames. An attacker-controlled server can exploit this by returning highly fragmented or infinite control and continuation frame sequences. This forces the client to allocate memory indefinitely on the managed heap, eventually provoking an unhandled Out-of-Memory (OOM) exception and application crash.
A heap out-of-bounds write vulnerability exists in Pillow prior to version 12.3.0 due to an integer overflow during image expansion calculations. The subsequent patch introduced a division-by-zero regression causing denial of service.