Skip to content

Bump System.Security.Cryptography.Pkcs to fix a moderate severity issue - #7773

Closed
bdovaz wants to merge 1 commit into
NuGet:devfrom
bdovaz:fix-security-issue
Closed

bdovaz wants to merge 1 commit into
NuGet:devfrom
bdovaz:fix-security-issue

Conversation

@bdovaz

@bdovaz bdovaz commented Oct 14, 2026

Copy link
Copy Markdown

Bug

Fixes: NuGet/Home#15103

Description

When I reference the latest version of NuGet.PackageManagement (7.9.0), I get:

Package 'System.Security.Cryptography.Pkcs' 8.0.1 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-2fmv-rv2c-59x7

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@bdovaz
bdovaz requested a review from a team as a code owner October 14, 2026 12:28
@dotnet-policy-service dotnet-policy-service Bot added the Community PRs created by someone not in the NuGet team label Oct 14, 2026
zateutsch pushed a commit to microsoft/winappCli that referenced this pull request Oct 14, 2026
 / GHSA-2fmv-rv2c-59x7 (#1079)

## What and why

Two new advisories (published 2026-10-13) affect
System.Security.Cryptography.Pkcs 8.0.0 to 8.0.1, patched in 8.0.2 and
10.0.13:

- GHSA-846f-f764-76mx (CVE-2026-84008, high): .NET denial of service
- GHSA-2fmv-rv2c-59x7 (CVE-2026-70162, medium): .NET denial of service

NuGet.Packaging 7.9.0 brings in Pkcs 8.0.1 transitively. NuGet audit
reports it as NU1902/NU1903, and `TreatWarningsAsErrors` turns those
into restore failures. `build-and-package` already fails this way on
open PRs (for example #1080):

```
error NU1903: Warning As Error: Package 'System.Security.Cryptography.Pkcs' 8.0.1 has a known high severity vulnerability, GHSA-846f-f764-76mx
error NU1902: Warning As Error: Package 'System.Security.Cryptography.Pkcs' 8.0.1 has a known moderate severity vulnerability, GHSA-2fmv-rv2c-59x7
```

This PR pins Pkcs to 10.0.13 in `Directory.Packages.props` and
references it from `WinApp.Cli.csproj`.

## Upstream status, and when to remove the pin

The real fix belongs in NuGet.Packaging, and it hasn't shipped yet:

- Reported upstream: NuGet/Home#15103 (open).
- Fix proposed: NuGet/NuGet.Client#7773 (open, not yet reviewed) bumps
the Pkcs dependency.

**Remove this pin** once winapp updates to a NuGet.Packaging release
that depends on Pkcs 8.0.2 or later (or 10.0.13+). Check with `dotnet
nuget why src/winapp-CLI/WinApp.Cli/WinApp.Cli.csproj
System.Security.Cryptography.Pkcs`.

We pin rather than suppress NU1902/NU1903 or relax
`TreatWarningsAsErrors`, so the next real advisory still fails the
build.

## Before / after

Nothing a user runs or sees changes. Restore resolves Pkcs 10.0.13
instead of 8.0.1.

## Not tested / risks

NuGet audit data may not reproduce the warnings locally; CI is the real
check.

## Checklist

- [x] Tested locally on Windows: `dotnet restore --force-evaluate
-p:TreatWarningsAsErrors=true` and a Release build with
`TreatWarningsAsErrors` pass; `dotnet nuget why` resolves only Pkcs
10.0.13.

Co-authored-by: Nikola Metulev <711864+nmetulev@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@zivkan

zivkan commented Oct 16, 2026

Copy link
Copy Markdown
Member

@bdovaz thanks for opening this PR. When the dev branch finally ships, it will be after .NET 8 is out of support. So, I created my own PR that updates this package, as well as the other System.* packages NuGet uses, to a supported .NET 10 package version: #7793

@nkolev92

Copy link
Copy Markdown
Member

Closing per Andy's comment.

@nkolev92 nkolev92 closed this Oct 20, 2026
@bdovaz
bdovaz deleted the fix-security-issue branch October 21, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PRs created by someone not in the NuGet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NU1902 Package 'System.Security.Cryptography.Pkcs' 8.0.1 has a known moderate severity vulnerability

3 participants