GeezerVison is showing github.com — Mock and core generator test restores report vulnerable System.Security.Cryptography.Pkcs versions · Issue #7412 · thomhurst/TUnit
Mock and core generator test restores report vulnerable System.Security.Cryptography.Pkcs versions #7412Labels P2Medium: edge case, mode divergence, flaky test, or workaround existsdependenciesPull requests that update a dependency file Description
Summary
Restoring the mock and core source generator test projects reports NU1902 for transitive System.Security.Cryptography.Pkcs versions 9.0.6 and 8.0.1 respectively. The dependency graph should resolve a version without the reported moderate-severity vulnerability so local validation and CI do not continue using the vulnerable package.
Reproduction
At commit ad542eb, with .NET SDK 10.0.403 on macOS arm64, run:
dotnet restore tests/TUnit.Mocks.SourceGenerator.Tests/TUnit.Mocks.SourceGenerator.Tests.csproj
dotnet restore tests/TUnit.Core.SourceGenerator.Tests/TUnit.Core.SourceGenerator.Tests.csproj
Expected and actual
Expected: no known-vulnerability warning from the restored dependency graph.
Actual: NU1902 reports System.Security.Cryptography.Pkcs 9.0.6 for the mock generator tests and 8.0.1 for the core generator tests, with advisory GHSA-2fmv-rv2c-59x7.
Acceptance criteria
- Both generator test dependency graphs resolve patched versions without GHSA-2fmv-rv2c-59x7 warnings.
- Verify restore for the supported target frameworks of both projects and run the affected generator suites.
- Preserve the existing supported target frameworks.
Please update both dependency graphs and verify restore no longer reports this advisory. Activityadded P2Medium: edge case, mode divergence, flaky test, or workaround exists on Nov 2, 2026thomhurst commented on Nov 2, 2026
The core generator snapshot project also reports NU1902 for System.Security.Cryptography.Pkcs 8.0.1, with the same advisory. Reproduction at ca4437c, .NET SDK 10.0.403 on macOS arm64: dotnet test --project tests/TUnit.Core.SourceGenerator.Tests --framework net10.0. Please include this dependency graph when updating the affected test dependencies. thomhurst commented on Nov 2, 2026
Also reproduced NU1902 for System.Security.Cryptography.Pkcs 8.0.1 while running dotnet test --project tests/TUnit.Core.SourceGenerator.Tests --framework net10.0 at PR #7348 commit edcf790, SDK 10.0.403 on macOS arm64. The warning names the same GHSA-2fmv-rv2c-59x7 advisory. Please include the core generator test dependency graph when fixing this issue. thomhurst commented on Nov 2, 2026
Also reproduced NU1902 for transitive System.Security.Cryptography.Pkcs 8.0.1 while restoring tests/TUnit.Core.SourceGenerator.Tests/TUnit.Core.SourceGenerator.Tests.csproj at c1c37a3 with .NET SDK 10.0.403 on macOS arm64. It reports the same GHSA-2fmv-rv2c-59x7 advisory. Please include the core generator test dependency graph when fixing this. thomhurst commented on Nov 3, 2026
The same advisory is also reported by dotnet test --project tests/TUnit.Core.SourceGenerator.Tests --framework net10.0 at 7c87a5e (SDK 10.0.403, macOS arm64), for resolved System.Security.Cryptography.Pkcs 8.0.1. Please include the core generator snapshot test dependency graph when fixing this issue. changed the title [-]Mock generator test restore reports vulnerable System.Security.Cryptography.Pkcs 9.0.6[/-] [+]Mock and core generator test restores report vulnerable System.Security.Cryptography.Pkcs versions[/+] on Nov 3, 2026thomhurst commented on Nov 3, 2026
Also reproduced NU1902 for System.Security.Cryptography.Pkcs 9.0.6 while restoring tests/TUnit.Analyzers.Tests on main commit 309ed46, SDK 10.0.403 on macOS arm64. Please include this test dependency graph in the fix. thomhurst commented on Nov 4, 2026
The analyzer test project also reports NU1902 for System.Security.Cryptography.Pkcs 9.0.6 at 10a0af7, using SDK 10.0.403 on macOS arm64. Reproduce with dotnet restore tests/TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj. Please include this dependency graph in the existing fix. thomhurst commented on Nov 4, 2026
Also reproduced in tests/TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj at 592bb95 using SDK 10.0.403: dotnet build tests/TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj -f net10.0 -m:2 reports NU1902 for System.Security.Cryptography.Pkcs 9.0.6 and the same advisory. Please include this test dependency graph when updating the affected projects. thomhurst commented on Nov 4, 2026
Also reproduced NU1902 for System.Security.Cryptography.Pkcs 9.0.6 when running dotnet test --project tests/TUnit.Analyzers.Tests --framework net10.0 at d46387f on macOS arm64 with SDK 10.0.403. Please include the analyzer test dependency graph when addressing this advisory. thomhurst commented on Nov 5, 2026
Reproduced NU1902 for System.Security.Cryptography.Pkcs 8.0.1 while running the net10.0 core generator tests for #7351 on main base 1a40c80. thomhurst commented on Nov 5, 2026
The same NU1902 advisory also occurs when restoring tests/TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj at 2cd3eee28efdf93f36d1d8a727a084764882f48b with SDK 10.0.403 on macOS arm64: System.Security.Cryptography.Pkcs 9.0.6 reports GHSA-2fmv-rv2c-59x7. Please include the analyzer test dependency graph in this fix. thomhurst commented on Nov 5, 2026
Confirmed during #7638 validation on main 4d359a0 with SDK 10.0.403: restoring tests/TUnit.Core.SourceGenerator.Tests still reports NU1902 for System.Security.Cryptography.Pkcs 8.0.1 (GHSA-2fmv-rv2c-59x7). Existing reproduction remains current. thomhurst commented on Nov 5, 2026
Confirmed again while validating #7433 on main base b9d47de: dotnet test --project tests/TUnit.Mocks.SourceGenerator.Tests --framework net10.0 reports NU1902 for System.Security.Cryptography.Pkcs 9.0.6 (GHSA-2fmv-rv2c-59x7). Tests pass; the restore warning remains. thomhurst commented on Nov 5, 2026
Confirmed NU1902 for System.Security.Cryptography.Pkcs 9.0.6 while restoring the mock source-generator tests for #7436 on main base 45d4a52, SDK 10.0.403, macOS arm64. Reproduction: dotnet test --project tests/TUnit.Mocks.SourceGenerator.Tests --framework net10.0. It reports the same GHSA-2fmv-rv2c-59x7 advisory already tracked here. thomhurst commented on Nov 5, 2026
The affected projects also include tests/TUnit.Analyzers.Tests: dotnet test --project tests/TUnit.Analyzers.Tests --framework net10.0 on main 5a18e53 / SDK 10.0.403 emits NU1902 for System.Security.Cryptography.Pkcs 9.0.6 (GHSA-2fmv-rv2c-59x7). Observed while validating #7462.
MetadataMetadataP2Medium: edge case, mode divergence, flaky test, or workaround existsdependenciesPull requests that update a dependency file DevelopmentNo branches or pull requestsIssue actions
|