NuGet vulnerable with Microsoft.Data.SqlClient 7.1.1 depending on System.Security.Cryptography.Pkcs 9.0.18
12:36 29 Oct 2026

I have a strange behaviour when using .NET 10 Library referencing NuGet Microsoft.Data.SqlClient 7.1.1. I receive a vulnerable warning of a transient package System.Security.Cryptography.Pkcs in version 9.0.18. I found some thread here https://github.com/dotnet/SqlClient/issues/4843


  
    Library
    net10.0-windows
  
  
    
  

I also found this version in the obj\project.assets.json

      "Microsoft.Data.SqlClient/7.1.1": {
        "type": "package",
        "dependencies": {
          "Microsoft.Bcl.Cryptography": "9.0.18",
          "Microsoft.Data.SqlClient.Extensions.Abstractions": "[7.1.1, 8.0.0)",
          "Microsoft.Data.SqlClient.Internal.Logging": "[7.1.1, 8.0.0)",
          "Microsoft.Data.SqlClient.SNI.runtime": "[7.1.0, 8.0.0)",
          "Microsoft.Extensions.Caching.Memory": "9.0.18",
          "Microsoft.IdentityModel.JsonWebTokens": "8.16.0",
          "Microsoft.IdentityModel.Protocols.OpenIdConnect": "8.16.0",
          "Microsoft.SqlServer.Server": "[1.0.0, 2.0.0)",
          "System.Configuration.ConfigurationManager": "9.0.18",
          "System.Security.Cryptography.Pkcs": "9.0.18",
          "System.Threading.RateLimiting": "9.0.18"
        },

Strange is that when I add UseWPF to the Project-Group, the vulnerable warning disapears because the package System.Security.Cryptography.Pkcs is not referenced anymore.


  
    Library
    net10.0-windows
    true
  
  
    
  

The obj\project.assets.json changes without System.Security.Cryptography.Pkcs.

      "Microsoft.Data.SqlClient/7.1.1": {
        "type": "package",
        "dependencies": {
          "Microsoft.Bcl.Cryptography": "9.0.18",
          "Microsoft.Data.SqlClient.Extensions.Abstractions": "[7.1.1, 8.0.0)",
          "Microsoft.Data.SqlClient.Internal.Logging": "[7.1.1, 8.0.0)",
          "Microsoft.Data.SqlClient.SNI.runtime": "[7.1.0, 8.0.0)",
          "Microsoft.Extensions.Caching.Memory": "9.0.18",
          "Microsoft.IdentityModel.JsonWebTokens": "8.16.0",
          "Microsoft.IdentityModel.Protocols.OpenIdConnect": "8.16.0",
          "Microsoft.SqlServer.Server": "[1.0.0, 2.0.0)",
          "System.Threading.RateLimiting": "9.0.18"
        },

Does anybody know more about how to fix this problem without using UseWPF?

c# nuget .net-10.0 microsoft-data-sqlclient