CVE-2026-96238
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 security feature bypass vulnerability (CVE-2026-96238) has been identified in the .NET SDK's template engine, which can acquire a template package from a feed that NuGet Package Source Mapping does not permit for that package, bypassing the configured feed trust boundary. An attacker who controls any feed in a developer's NuGet configuration could have a template package installed from that feed instead of the trusted one.
Per CWE-346: Origin Validation Error, the weakness is a product that does not properly verify that the source of data or communication is valid.
This issue affects every .NET 6 SDK on Windows, Linux and macOS, including the End-of-Life .NET 6.0 line covered by NES. Only developers and build machines that configure Package Source Mapping and install or update templates with dotnet new are exposed. Application runtimes are not affected.
Details
Module Info
- Product: .NET SDK
- Affected packages:
Microsoft.TemplateEngine.Edge(the template engine bundled in the .NET SDK, not a package applications reference) - Affected versions:
- .NET SDK
>= 6.0.100 <= 6.0.437
- .NET SDK
- Package manager: Windows Installer, Linux packages (.deb, .rpm), archives (.zip, .tar.gz)
- GitHub repository: https://github.com/dotnet/templating
- Published packages: Download .NET (Linux, macOS, and Windows)
- Fixed in:
- NES for .NET 6.0.47 (.NET SDK 6.0.438, bundling template engine 6.0.427.1)
Vulnerability Info
This Medium-severity vulnerability is found in the NuGet installer of the .NET template engine, Microsoft.TemplateEngine.Edge, which the SDK uses for dotnet new --install and for template update checks and updates. Package Source Mapping lets a NuGet configuration pin each package ID to the feeds trusted to serve it. The template engine ignored the mapping and searched every enabled feed, and updates also reused the feed a template was first installed from, which skipped the mapping as well. A template package could therefore be acquired from a feed the mapping does not allow. Exploitation requires the attacker to control a configured feed and the user to install or update a template.
The fix applies the mapping when the template engine chooses feeds, keeping only those mapped to the package ID and failing with a specific error when none match. Updates no longer reuse the stored install feed.
Compatibility note: when Package Source Mapping is enabled, dotnet new --install now refuses extra feeds passed with --nuget-source (or --add-source), matching Microsoft's .NET 8 fix. Add the feed to the NuGet configuration and map the package to it instead.
This vulnerability has been present since at least .NET SDK 6.0.
Mitigation
.NET 6 is End-of-Life and will not receive any updates from Microsoft 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 to a supported .NET SDK, one of:
- .NET SDK 8.0.132 or later (8.0.1xx feature band) or 8.0.426 or later (8.0.4xx)
- .NET SDK 9.0.122 or later (9.0.1xx feature band) or 9.0.319 or later (9.0.3xx)
- .NET SDK 10.0.113 or later (10.0.1xx feature band) or 10.0.402 or later (10.0.4xx)
- Leverage a commercial support partner like HeroDevs for post-EOL security support, including NES for .NET 6.0.47 (.NET SDK 6.0.438) or later.
Credits
Vantage Sec and Raffaello Tamagnini, as credited in Microsoft's advisory.