CVE-2026-96222
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 spoofing vulnerability (CVE-2026-96222) has been identified in .NET's Signed XML implementation, System.Security.Cryptography.Xml. Microsoft describes the issue as KeyInfoX509Data accepting serialized certificate formats that contain attacker-controlled chain metadata instead of requiring a plain X.509 certificate, contributing to certificate-forgery and token-spoofing paths.
Per CWE-295: Improper Certificate Validation, the product does not validate, or incorrectly validates, a certificate.
This issue affects .NET 6, including NES for .NET releases through 6.0.46. System.Security.Cryptography.Xml ships in-box in the ASP.NET Core and Windows Desktop shared frameworks and as a standalone NuGet package. Applications are exposed when they process signed XML whose KeyInfo carries <X509Certificate> elements, as WS-Trust and other XML token validation does. Microsoft's advisory lists only the System.Security.Cryptography.Xml package for .NET 8.0 as affected and does not list .NET 9.0 or later; .NET 6 is past end of life and is not assessed there.
Additionally, if you've deployed self-contained applications targeting any of the impacted versions, these applications are also vulnerable and must be recompiled and redeployed.
Details
Module Info
- Product: .NET
- Affected packages: Microsoft.AspNetCore.App and Microsoft.WindowsDesktop.App (in-box copies of System.Security.Cryptography.Xml); System.Security.Cryptography.Xml (standalone NuGet package)
- Affected versions:
- Microsoft.AspNetCore.App, Microsoft.WindowsDesktop.App
>= 6.0.0 <= 6.0.46 - System.Security.Cryptography.Xml
>= 6.0.0 <= 6.0.2.2
- Microsoft.AspNetCore.App, Microsoft.WindowsDesktop.App
- Package manager: NuGet, Windows Installer, Docker
- GitHub repository: https://github.com/dotnet/runtime
- Published packages: Download .NET (Linux, macOS, and Windows); System.Security.Cryptography.Xml on NuGet
- Fixed in: NES for .NET 6.0.47 (System.Security.Cryptography.Xml 6.0.2.3)
Vulnerability Info
This High-severity vulnerability is found in the KeyInfoX509Data class of System.Security.Cryptography.Xml as shipped for .NET 6. When KeyInfoX509Data.LoadXml reads an <X509Certificate> element from a signature's KeyInfo, it decoded the bytes with the X509Certificate2 byte-array constructor. That constructor accepts more than a single certificate: it also loads PKCS#7 and PFX blobs and, on Windows, serialized certificates, which carry certificate properties chosen by whoever produced them. A consumer that trusts what KeyInfoX509Data hands back could therefore act on sender-controlled metadata rather than a plain certificate.
NES for .NET 6.0.47 applies the same change Microsoft made in .NET 8 servicing. LoadXml now checks the content type with X509Certificate2.GetCertContentType and accepts only a single X.509 certificate in DER or PEM form, throwing a CryptographicException for anything else. The KeyInfoX509Data(byte[]) constructor is unchanged, as in Microsoft's .NET 8 fix.
Compatibility note: applications that relied on <X509Certificate> elements carrying other formats can restore the old behavior with the AppContext switch System.Security.Cryptography.Xml.AllowNonCertificateX509Data (default false). Doing so reopens the vulnerability.
This vulnerability has been present since at least .NET 6.0 and likely earlier.
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:
- NES for .NET 6.0.47 or later
- System.Security.Cryptography.Xml 8.0.5 or later (.NET 8; Microsoft's advisory also directs .NET 8 users to install .NET 8.0.32)
- .NET 9.0 or later, which Microsoft's advisory does not list as affected
- Leverage a commercial support partner like HeroDevs for post-EOL security support, including NES for .NET 6.0.47 or later. Applications with an explicit System.Security.Cryptography.Xml package reference should also move it to 6.0.2.3 from the NES feed, because NuGet otherwise keeps resolving Microsoft's unpatched 6.0.2.
Credits
Vaisha Bernard with Eye Security, as credited in Microsoft's advisory.