Description
Description
If you take a dependency on System.Security.Cryptography.Pkcs 8.0, you will receive a package vulnerability warning due to the vulnerability identified in #104622. That warning occurs because System.Security.Cryptography.Pkcs 8.0 has a dependency on System.Formats.Asn1 >= 8.0.0, and System.Formats.Asn1 8.0.0 is the vulnerable package. System.Formats.Asn1 8.0.1 is available, and no longer contains the vulnerability.
To fix this without requiring customers to take a dependency on a nested package that isn't directly referenced in their code (customers should not have to do that), Microsoft should publish a System.Security.Cryptography.Pkcs 8.0.1 package that has a dependency on System.Formats.Asn1 >= 8.0.1.
Reproduction Steps
- Create a .NET 8 project that takes a dependency on the latest System.Security.Cryptography.Pkcs 8.x package.
- Compile your project in Visual Studio.
Expected behavior
The project will compile without any package vulnerability warnings.
Actual behavior
The project compiles, and Visual Studio identifies that you have vulnerable packages.
Regression?
No
Known Workarounds
Take a hard dependency on System.Formats.Asn1 8.0.1.
NOTE: Taking a dependency on a nested package that you do not reference in your code really isn't a viable workaround, because it adds something else to manage that may very well not be cleaned up later, and it's a transient dependency, so really the package that does reference it and use it directly needs to be updated. That's the proper fix.
Configuration
.NET 8.0
Windows 11
x64
This issue is not specific to Windows or x86/x64.
Other information
- It would be really nice if the NuGet Package Manager would properly identify packages that have internal dependencies that contain known vulnerabilities so that customers have someone to reach out to when a package like System.Security.Cryptography.Pkcs needs an update. Finding this so that I could come here to log the bug required opening up the obj/project.assets.json file and inspecting the contents to determine where the vulnerability warning was really coming from.