Microsoft.AspNetCore.DataProtection
Affected
- introduced
10.0.0, fixed10.0.7(ecosystem)
Fixed versions
10.0.7
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: BIT-aspnet-core-2026-40372, CVE-2026-40372
Microsoft Security Advisory CVE-2026-40372 – ASP.NET Core Elevation of Privilege
Executive Summary:
A bug in Microsoft.AspNetCore.DataProtection 10.0.0-10.0.6 NuGet packages can give an attacker the opportunity to execute an Elevation of Privilege attack by forging authentication cookies, and also allows some protected payloads to be decrypted.
If an attacker used forged payloads to authenticate as a privileged user during the vulnerable window, they may have induced the application to issue legitimately-signed tokens (session refresh, API key, password reset link, etc.) to themselves. Those tokens remain valid after upgrading to 10.0.7 unless the DataProtection key ring is rotated.
This is comparable in capability to MS10-070, which exploited a similar padding-oracle condition in ASP.NET's legacy encryption infrastructure.
Announcement
Announcement for this issue can be found at https://github.com/dotnet/announcements/issues/395
CVSS Details
Affected Platforms
<a name="affected-packages"></a>Affected Packages
The vulnerability affects some Microsoft .NET projects if they use any of affected package versions listed below
<a name="ASP.NET Core 10"></a>ASP.NET Core 10
Package name | Affected version | Patched version
------------ | ---------------- | -------------------------
Microsoft.AspNetCore.DataProtection | >=10.0.0, <=10.0.6 | 10.0.7
Advisory FAQ
<a name="how-affected"></a>How do I know if I am affected?
Primary affected configuration (10.0.6 on net10.0)
You are affected if ALL of the following are true:
Microsoft.AspNetCore.DataProtection version 10.0.6 from NuGet (directly or transitively via, e.g., Microsoft.AspNetCore.DataProtection.StackExchangeRedis, .EntityFrameworkCore, .AzureKeyVault, .AzureStorage, .Redis), ANDThe affected 10.0.6 NuGet binary was actually loaded at runtime. This happens when either the application does NOT target the Microsoft.NET.Sdk.Web NOR has a Microsoft.AspNetCore.App framework reference either directly or transitively UNLESS you opt out of PrunePackageReference which is enabled by default in .NET 10.
Secondary affected configuration (10.0.x on net462 / netstandard2.0)
You are also affected if:
Microsoft.AspNetCore.DataProtection versions 10.0.0 through 10.0.6 from NuGet, ANDnet462 or netstandard2.0 target framework asset of that package. This occurs when your application does not target net10.0 and consumes the package (e.g. net8.0, net9.0, net481 for mono, etc.). This combination is unusual because 10.0 NuGet packages are generally intended for use with .NET 10.This secondary population is much smaller and is expected to primarily consist of:
netstandard2.0 and reference the 10.0 DataProtection package.These configurations use the same managed authenticated encryptor code path on all operating systems (the CNG path is only available on the net10.0 asset), so the Windows exception below does not apply to them.
Not affected
net10.0 and your installed ASP.NET Core shared framework version is ≥ your PackageReference version of Microsoft.AspNetCore.DataProtection. In this case the (correct) shared framework copy is loaded and the NuGet copy is not used. For example, shared framework 10.0.6 + PackageReference 10.0.6 is safe; shared framework 10.0.5 + PackageReference 10.0.6 is not.Microsoft.AspNetCore.DataProtection 8.0.x or 9.0.x from NuGet, on any target framework, any operating system, any shared framework version. The defective code path was introduced during 10.0 development and was never backported to the 8.0 or 9.0 servicing branches.<a name="how-fix"></a>How do I fix the issue?
Example using the built-in key manager:
// Run once, from an application with access to the same key ring.
// Replace the cutoff with a timestamp just before you deployed 10.0.6.
var services = new ServiceCollection()
.AddDataProtection()
// ... your existing repository / protection configuration ...
.Services
.BuildServiceProvider();
var keyManager = services.GetRequiredService<IKeyManager>();
keyManager.RevokeAllKeys(
revocationDate: DateTimeOffset.UtcNow, // revoke all keys currently in the ring
reason: "CVE-TBD: DataProtection 10.0.6 validation bypass");
RevokeAllKeys marks every existing key as revoked; a new key is auto-generated on the next protect operation. All users will need to sign in again, all antiforgery tokens will be reissued, etc.
If you can be more surgical — for instance, you know no key older than T was used by an affected process — use RevokeKey(Guid keyId, string reason) instead to revoke only the keys that were active during the vulnerable window.
If your application does not issue such long-lived artifacts via authenticated endpoints, key rotation alone is sufficient.
Recommended
IDataProtector.Protect output, treat those secrets as potentially disclosed and rotate them at their respective sources.Critical Basis: The source's own band: CRITICAL
10.0.0, fixed 10.0.7 (ecosystem)10.0.7
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0