ASP.NET Core CVE-2026-40372 Privilege Escalation Patched

Microsoft patches CVE-2026-40372, a critical privilege escalation flaw in ASP.NET Core. Learn how it works and how to protect your apps now.
Microsoft Patches CVE-2026-40372 in ASP.NET Core
Microsoft has pushed a security update addressing CVE-2026-40372, a critical privilege escalation vulnerability in ASP.NET Core. The flaw allows an authenticated attacker to elevate their permissions within a running application, potentially gaining control over resources they should never touch. If you are running any ASP.NET Core application in production, this patch is not optional.
Privilege escalation bugs in web frameworks are particularly nasty. Unlike a simple information disclosure issue, this class of vulnerability lets attackers pivot from a low-privilege foothold into full application compromise. CVE-2026-40372 sits in that category, making it a high-priority fix for development and platform teams alike.
How the CVE-2026-40372 Vulnerability Works
The flaw exists in how ASP.NET Core handles certain authorization checks during request processing. Under specific conditions, the middleware pipeline can be manipulated to bypass role or claim validation, allowing a lower-privileged user to execute actions restricted to administrators or system accounts.
Attackers do not need to be unauthenticated. They only need a valid session, even a minimal one. From there, a crafted HTTP request targeting vulnerable endpoints can trigger the bypass. The attack surface is broader than it first appears because many ASP.NET Core applications expose internal APIs or admin routes protected solely by middleware-based authorization rather than database-level access controls.
No public exploit code has been confirmed at the time of writing, but given the severity rating and the clarity of the attack vector, weaponization is a realistic short-term risk.
What Is at Risk for Developers and Teams
Any ASP.NET Core application relying on built-in authorization middleware without additional server-side permission enforcement is exposed. That covers a significant portion of modern .NET web APIs and Razor Pages apps deployed on Azure, IIS, or containerized environments.
The practical impact includes unauthorized access to admin panels, data exfiltration from protected endpoints, and the ability to modify application state or user records. In multi-tenant SaaS applications, the blast radius expands further. One compromised low-privilege account could access or corrupt data belonging to other tenants.
Teams using third-party identity providers are not automatically protected. The vulnerability is in the framework layer, not the authentication provider.
How to Protect Your ASP.NET Core Applications
The immediate step is straightforward: update. Microsoft has released patched versions of the ASP.NET Core runtime and SDK. Pull the update, rebuild your application, and redeploy.
Beyond the patch, a few hardening steps are worth applying now:
- Add authorization checks at the service and data layer, not just in middleware. Never rely on a single enforcement point.
- Audit your route and endpoint authorization policies. Confirm every sensitive route has explicit role or claim requirements.
- Review your dependency graph for transitive pulls of affected ASP.NET Core packages. Your direct dependencies may be patched, but nested packages could still be vulnerable.
- Run a targeted scan against your endpoints to surface any authorization gaps before attackers find them. You can do this directly at /scan.
- Monitor logs for unusual privilege patterns. Requests from low-privilege accounts hitting admin-scoped endpoints are a signal worth alerting on.
You can also check our web security vulnerability guide for a broader breakdown of how authorization flaws are classified and exploited.
FAQ
Does this vulnerability affect ASP.NET Framework as well as ASP.NET Core? Based on Microsoft's advisory, CVE-2026-40372 specifically affects ASP.NET Core. Classic ASP.NET Framework applications use a different middleware pipeline and are not listed as affected. Verify your runtime version before assuming you are clear.
Do I need to update my app code or just the runtime? Patching the runtime handles the core fix. However, rebuilding and redeploying against the updated SDK ensures your compiled output reflects the corrected library versions. Both steps are recommended.
Can a WAF block exploitation attempts for CVE-2026-40372? A WAF can add a detection layer, but it is not a substitute for patching. Authorization bypass attacks often use syntactically valid requests, making them difficult to distinguish from legitimate traffic at the perimeter level.
Your ASP.NET Core app may already be exposed. Run a free automated scan at VibeWShield to check your endpoints for authorization vulnerabilities before someone else does.
Free security scan
Is your app vulnerable to similar attacks?
VibeWShield automatically scans for these and 18 other security checks in under 3 minutes.
Scan your app free