Skip to content

Pin the vulnerable transitive packages - #54

Merged
RoelantVos merged 3 commits into
mainfrom
feature/transitive-packages
Oct 26, 2026
Merged

RoelantVos merged 3 commits into
mainfrom
feature/transitive-packages

Conversation

@RoelantVos

@RoelantVos RoelantVos commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Release restore of Direct_Framework.Integration.Tests failed the NuGet audit on two transitive packages (seen in the first run of the release pipeline, #53): SSH.NET 2024.2.0 through Testcontainers.MsSql (GHSA-mggc-4xg6-vcxf, GHSA-q939-rpr3-3284) and System.Security.Cryptography.Pkcs 9.0.9 through Microsoft.SqlServer.DacFx (GHSA-2fmv-rv2c-59x7, GHSA-846f-f764-76mx).

  • Directory.Packages.props: enable CentralPackageTransitivePinningEnabled and pin SSH.NET 2026.0.0 and System.Security.Cryptography.Pkcs 10.0.14, the latest stable versions on nuget.org. Transitive pinning also makes the central Microsoft.NET.Test.Sdk entry binding for the version MSTest 4.0.2 pulls in, so it moves from 17.14.1 to 18.0.1 (NU1109 otherwise).
  • Direct_Framework.Integration.Tests/packages.lock.json regenerated with dotnet restore.
  • Workflow: the test job restores the test project once with warnings as errors, so a vulnerable package fails the run at that step, and keeps running the tests in Debug. The Release build of the test project fails on about 190 code-analysis errors (CA2007, CA1707, CA1303 and others) that Directory.Build.props turns into errors for every project in Release; that is pre-existing on main and not touched here.

Testing

  • Local (Windows, .NET 10 SDK): restore clean with no NU1902/NU1903/NU1109; test project builds in Debug with 0 errors; Direct_Framework.sqlproj builds in Release with 0 errors; integration tests under Podman against a freshly built dacpac: 23 of 23 pass.
  • The pull request run of the release pipeline repeats the restore gate, the build and the tests on the runners.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK

claude and others added 3 commits October 26, 2026 17:51
Pin SSH.NET (pulled in by Testcontainers.MsSql) and System.Security.Cryptography.Pkcs (pulled in by Microsoft.SqlServer.DacFx) through central package management with transitive pinning, so the Release restore of the test project passes the NuGet audit (NU1902/NU1903). The integration tests in the workflow run in Release again, which makes the audit part of the gate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
With CentralPackageTransitivePinningEnabled, the central Microsoft.NET.Test.Sdk
17.14.1 also pinned the transitive one that MSTest 4.0.2 depends on, which the
restore rejected as a downgrade (NU1109). Raise it to 18.0.1, the version MSTest
asks for, and regenerate packages.lock.json for the pinned package set.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
The Release build of the test project fails on the code analysis rules that Directory.Build.props enables for every project (AnalysisMode AllEnabledByDefault with warnings as errors), which predates the package pins. The tests therefore run in Debug again, and a separate restore with warnings as errors makes the NuGet audit the gate it was meant to be.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8xKsmMZRuuoGUZqqpAmVK
@RoelantVos
RoelantVos marked this pull request as ready for review October 26, 2026 18:24
@RoelantVos
RoelantVos merged commit d663f26 into main Oct 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants