Raise SSH.NET past the advisory Testcontainers drags in - #60
Merged
Conversation
`Testcontainers` 4.13.0 resolves `SSH.NET` 2025.1.0, which is GHSA-q939-rpr3-3284, high severity: ScpClient's recursive download writes wherever a malicious server's filenames point. Every restore has been reporting it as NU1903, on both target frameworks. It is a test-only path and this repository does not treat warnings as errors, so nothing was failing -- it was just being printed and ignored. Patched in 2026.0.0, and 4.13.0 is Testcontainers' own latest release, so there is nothing upstream to wait for. Raised by referencing it directly from Healthie.Tests.Unit rather than by turning on CentralPackageTransitivePinningEnabled. That switch pins one version of every transitive package across the solution, which collides with the per-target-framework Microsoft.Extensions.* versions this file deliberately keeps apart: enabling it fails restore with 34 NU1109 downgrade errors. Verified both ways round. `dotnet restore --locked-mode` and `dotnet build -c Release` now finish with no warnings at all, where they previously printed two.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testcontainers4.13.0 resolvesSSH.NET2025.1.0 — GHSA-q939-rpr3-3284, high severity: ScpClient recursive download allows arbitrary file write via server-controlled SCP filenames.Every restore has been printing it as NU1903 on both target frameworks. It is a test-only path and this repository does not set
TreatWarningsAsErrors, so nothing failed — it was simply printed and ignored. (The siblingLakeWright.NETdoes set it, and there the same advisory tookmainred on its own.)Patched in 2026.0.0, and Testcontainers 4.13.0 is its own latest release, so there is nothing upstream to wait for.
Why a direct reference, not transitive pinning
The obvious fix is
CentralPackageTransitivePinningEnabledplus aPackageVersion. I tried that first and it does not work here: that switch forces a single version of every transitive package across the solution, which collides with the per-target-frameworkMicrosoft.Extensions.*versions this repository deliberately keeps apart — the ones the comment at the top ofDirectory.Packages.propsexists to protect. Restore fails with 34 NU1109 downgrade errors.Referencing
SSH.NETdirectly fromHealthie.Tests.Unitraises it in the one project that pulls it, and leaves the multi-targeting strategy alone.Verification
dotnet restore --locked-modedotnet build -c ReleaseSSH.NET 2025.1.0 (Transitive)SSH.NET 2026.0.0 (Direct), net8.0 and net10.0Dependabot never raised an alert for this, because the vulnerable package is transitive. NuGet's own audit is what surfaced it.