[Secrets] Restore fails NuGetAudit: SqlClient 6.0.2 pulls System.Security.Cryptography.Pkcs 9.0.4 (GHSA-846f-f764-76mx, GHSA-2fmv-rv2c-59x7) #22

Closed
opened 2026-11-09 12:24:27 -05:00 by dohertj2 · 1 comment
Owner

dotnet restore ZB.MOM.WW.Secrets.slnx fails on a clean machine (reproduced 2026-11-09):

ZB.MOM.WW.Secrets.Replicator.SqlServer.csproj : error NU1902: Warning As Error: Package 'System.Security.Cryptography.Pkcs' 9.0.4 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-2fmv-rv2c-59x7
ZB.MOM.WW.Secrets.Replicator.SqlServer.csproj : error NU1903: Warning As Error: Package 'System.Security.Cryptography.Pkcs' 9.0.4 has a known high severity vulnerability, https://github.com/advisories/GHSA-846f-f764-76mx

Cli, Tests and Replicator.SqlServer.Tests raise the same advisories as warnings.

Source: dotnet nuget why → Microsoft.Data.SqlClient 6.0.2 → System.Security.Cryptography.Pkcs 9.0.4 (transitive).

Workaround in use: -p:NuGetAudit=false. The scadaproj#18 work had to restore this way.

Do:

  • Add a transitive security pin for System.Security.Cryptography.Pkcs to a patched version in Directory.Packages.props. Transitive pinning is already enabled for the SQLitePCLRaw pin, so this is the same pattern; alternatively, bump SqlClient if a release pulls a patched Pkcs.
  • Restore with the audit on, and run the suite.
  • Publish with the next Secrets release.
  • Check the other *.SqlServer packages for the same chain: ZB.MOM.WW.Auth.ApiKeys.SqlServer and the apps that reference SqlClient 6.0.2.
`dotnet restore ZB.MOM.WW.Secrets.slnx` fails on a clean machine (reproduced 2026-11-09): ``` ZB.MOM.WW.Secrets.Replicator.SqlServer.csproj : error NU1902: Warning As Error: Package 'System.Security.Cryptography.Pkcs' 9.0.4 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-2fmv-rv2c-59x7 ZB.MOM.WW.Secrets.Replicator.SqlServer.csproj : error NU1903: Warning As Error: Package 'System.Security.Cryptography.Pkcs' 9.0.4 has a known high severity vulnerability, https://github.com/advisories/GHSA-846f-f764-76mx ``` `Cli`, `Tests` and `Replicator.SqlServer.Tests` raise the same advisories as warnings. **Source:** `dotnet nuget why` → `Microsoft.Data.SqlClient` 6.0.2 → `System.Security.Cryptography.Pkcs` 9.0.4 (transitive). **Workaround in use:** `-p:NuGetAudit=false`. The scadaproj#18 work had to restore this way. **Do:** - Add a transitive security pin for `System.Security.Cryptography.Pkcs` to a patched version in `Directory.Packages.props`. Transitive pinning is already enabled for the SQLitePCLRaw pin, so this is the same pattern; alternatively, bump SqlClient if a release pulls a patched Pkcs. - Restore with the audit on, and run the suite. - Publish with the next Secrets release. - Check the other `*.SqlServer` packages for the same chain: `ZB.MOM.WW.Auth.ApiKeys.SqlServer` and the apps that reference SqlClient 6.0.2.
dohertj2 added the type:bugpriority:p2 labels 2026-11-09 12:24:27 -05:00
Author
Owner

Fixed on main 8bb2679 — transitive pin System.Security.Cryptography.Pkcs 9.0.21 (first patched in the 9.0 line; 9.0.0–9.0.20 and 10.0.0–10.0.12 are affected, so 10.0.7 still failed) in both ZB.MOM.WW.Secrets/Directory.Packages.props and ZB.MOM.WW.Auth/Directory.Packages.props (Auth's ApiKeys.SqlServer had the same chain).

Evidence: dotnet restore clean with NuGetAudit ON for both solutions; Secrets tests 212+17+49+38+196 passed / 0 failed; Auth 141+148+19+18 passed / 0 failed. Consumer-app pins tracked separately (new issue).

Fixed on main 8bb2679 — transitive pin `System.Security.Cryptography.Pkcs` **9.0.21** (first patched in the 9.0 line; 9.0.0–9.0.20 and 10.0.0–10.0.12 are affected, so 10.0.7 still failed) in both `ZB.MOM.WW.Secrets/Directory.Packages.props` and `ZB.MOM.WW.Auth/Directory.Packages.props` (Auth's ApiKeys.SqlServer had the same chain). Evidence: `dotnet restore` clean with NuGetAudit ON for both solutions; Secrets tests 212+17+49+38+196 passed / 0 failed; Auth 141+148+19+18 passed / 0 failed. Consumer-app pins tracked separately (new issue).
Sign in to join this conversation.