Fix - Nuke NU1901: Package 'NuGet.Packaging' 6.12.1 has a known low severity vulnerability
[C#, .NET, NukeBuild]
You may get the following build warning when using NukeBuild:
warning NU1901: Package 'NuGet.Packaging' 6.12.1 has a known low severity vulnerability, https://github.com/advisories/GHSA-g4vj-cjjj-v7hg
The error is because the package, or one of its dependencies, has a low severity vulnerability.
The details of the packages involved are as outlined here, as well as the details of the fix.
This package, Nuget.Packaging, is a transient dependency, and the problem is that the dependency happens to be a vulnerable one.
The fix for this is to directly installed a patched version.
dotnet add package NuGet.Packaging
This is 7.3.1 as of the time of writing this.
The project should now build without any warnings.
Happy hacking!