Skip to content

Raise SSH.NET past the advisory Testcontainers drags in - #60

Merged
ivanvyd merged 1 commit into
mainfrom
fix/ssh-net-advisory
Aug 14, 2026
Merged

Raise SSH.NET past the advisory Testcontainers drags in#60
ivanvyd merged 1 commit into
mainfrom
fix/ssh-net-advisory

Conversation

@ivanvyd

@ivanvyd ivanvyd commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Testcontainers 4.13.0 resolves SSH.NET 2025.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 sibling LakeWright.NET does set it, and there the same advisory took main red 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 CentralPackageTransitivePinningEnabled plus a PackageVersion. 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-framework Microsoft.Extensions.* versions this repository deliberately keeps apart — the ones the comment at the top of Directory.Packages.props exists to protect. Restore fails with 34 NU1109 downgrade errors.

Referencing SSH.NET directly from Healthie.Tests.Unit raises it in the one project that pulls it, and leaves the multi-targeting strategy alone.

Verification

command before after
dotnet restore --locked-mode exit 0, NU1903 ×2 exit 0, no NU1903
dotnet build -c Release 2 warnings 0 warnings, 0 errors
lock file SSH.NET 2025.1.0 (Transitive) SSH.NET 2026.0.0 (Direct), net8.0 and net10.0

Dependabot never raised an alert for this, because the vulnerable package is transitive. NuGet's own audit is what surfaced it.

`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.
@ivanvyd
ivanvyd merged commit 4c8c33e into main Aug 14, 2026
7 of 8 checks passed
@ivanvyd
ivanvyd deleted the fix/ssh-net-advisory branch August 14, 2026 01:31
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.

1 participant