Jul 21, 2026·6 min read·157 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 Server-Side Request Forgery (SSRF) vulnerability exists in the rmcp OAuth client, which is part of the Model Context Protocol (MCP) Rust SDK. The vulnerability arises from insecure processing of the resource_metadata parameter in WWW-Authenticate headers returned by a malicious or compromised MCP server. The client parses and fetches absolute URLs from this header without validation of scheme, origin, or network routing, allowing remote attackers to initiate HTTP GET requests to local network interfaces, RFC 1918 private subnets, or cloud metadata endpoints.
A module allowlist bypass vulnerability (CVE-2026-92945 / GHSA-7q3f-wx44-378m) was identified in the vm2 sandboxing library prior to version 3.11.7. This flaw permits unauthenticated or untrusted code running within the sandbox environment to bypass explicit module restrictions. When the transitive resolution option is disabled, the system fails to validate file system path boundaries, allowing prefix-sharing sibling directories to be resolved and loaded, thereby escaping intended sandbox restrictions.
CVE-2026-92941 is a critical sandbox-escape and trust-manipulation vulnerability in the vm2 library (versions 3.11.3 to 3.11.6). This security flaw allows untrusted code executing within a NodeVM sandbox environment to compromise the global TLS trust store of the host Node.js process. By leveraging a design flaw where the host's native 'tls.setDefaultCACertificates' can be executed via a proxy wrapper, combined with a bridge unwrapping bypass in the 'url' module, an attacker can modify the process-wide default root Certificate Authorities. Consequently, all subsequent outbound TLS/HTTPS clients running on the host thread are forced to trust attacker-signed certificates, facilitating transparent Man-in-the-Middle (MitM) attacks. The vulnerability was resolved in version 3.11.7 of vm2 by introducing built-in member-level sanitization before applying read-only proxy wrappers.
A critical engine-level reachability failure in Node.js 26 running V8 14.6 allows attackers to escape the vm2 sandbox environment. When consecutive prototype properties are modified using sequential assignments, a V8 optimization bug fails to invalidate the PromiseThenLookupChain protector. By calling Promise.prototype.finally, the attacker bypasses the vm2 wrappers, hijacks the promise reaction using a custom constructor, triggers a calibrated stack overflow to capture a host-realm RangeError, and executes arbitrary shell commands on the host.
A critical sandbox escape vulnerability in the vm2 library allows sandboxed JavaScript code to bypass containment and execute arbitrary native code on the host process. This occurs when the host's builtin crypto module is exposed to the NodeVM environment. Although vm2 implements a read-only proxy layer to restrict direct modifications to host properties, it does not prevent invocation of host-level functions. By calling the crypto.setEngine API with a path to a malicious native library on disk, an attacker can trigger OpenSSL's dynamic module loader. The host's operating system loader immediately runs the dynamic library's initializers/constructors before verifying engine compatibility, leading to remote code execution in the context of the host process.
CVE-2026-92938 is a critical sandbox escape vulnerability in the vm2 library (versions 3.11.3 through 3.11.6) that allows arbitrary native code execution on the host when the node:sqlite built-in module is loaded inside a sandboxed NodeVM environment.