Vulnerabilities in pkg:nuget/SSH.NET
PACKAGECVE-2026-85756 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting SSH.NET libraries in the NuGet ecosystem. The issue involves scpclient allows server-side rce via default scp path handling. Remediation is available by upgrading affected packages to version 2026.0.0.
pkg:nuget/SSH.NET
Vulnerability advisories affecting package pkg:nuget/SSH.NET. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-mggc-4xg6-vcxf | CVE-2026-85756 | HIGH | SSH.NET: ScpClient allows server-side RCE via default SCP path handling |
| GHSA-q939-rpr3-3284 | CVE-2026-48798 | HIGH | SSH.NET: ScpClient Recursive Download Allows Arbitrary File Write via Server-Controlled SCP Filenames |
| GHSA-72p8-v4hg-v45p | CVE-2022-29245 | MODERATE | Weak private key generation in SSH.NET |
CVE-2026-85756 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-85756
To remediate this vulnerability, upgrade all affected SSH.NET dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade SSH.NET to 2026.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for SSH.NET
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-85756, inspect your project dependencies for SSH.NET:
inspect dependencies for SSH.NET
Analyze the terminal output to locate any version of SSH.NET in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.0.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In SSH.NET, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-85756 Affected SSH.NET Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
SSH.NET
|
NuGet |
< 2026.0.0
|
2026.0.0
|
References
Frequently Asked Questions
What is CVE-2026-85756?
Which SSH.NET versions are affected?
What version fixes CVE-2026-85756?
Is SSH.NET affected?
What is the CVSS score of CVE-2026-85756?
What CWE is associated with CVE-2026-85756?
How can I check NuGet dependencies for CVE-2026-85756?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mggc-4xg6-vcxf",
"modified" : "2026-09-17T17:18:01Z",
"published" : "2026-09-17T17:18:01Z",
"aliases" : [ "CVE-2026-85756" ],
"summary" : "SSH.NET: ScpClient allows server-side RCE via default SCP path handling",
"details" : "## Summary\n\nDefault SCP remote-path handling places caller-supplied paths into the command that runs scp on the server. On a shell-based server that command is interpreted by a shell, so an attacker-influenced path that is not quoted to suit that shell can execute as a command as the authenticated SSH user. SSH.NET provides `ScpClient.RemotePathTransformation` to control escaping behaviour (defaulting to `RemotePathTransformation.DoubleQuote`) but cannot guarantee safety for arbitrary remote command interpreters. This is inherent to running scp over a remote shell (cf. CVE-2020-15778).\n\n## Impact\n\nCommand execution on the SSH server as the authenticated SSH user, when an application passes an attacker-influenced remote path to ScpClient against a shell-based server.\n\nExploitation depends on conditions beyond the attacker's control: the remote server must be shell-based, and the attacker-influenced path must be crafted to defeat the quoting applied by the transformation in effect — that is, to use metacharacters that it does not neutralise (for example $(...) or backticks, which survive the default double-quoting on a POSIX shell). A path that does not meet these escaping rules, or a non-shell-based server, does not result in command execution.\n\n## Remediation\n\nThe fixed release obsoletes the constructors that silently defaulted the path transformation and adds constructors that require an explicit `IRemotePathTransformation`, so callers are required to choose one that suits their server and trust environment. For POSIX shells, the library provides `RemotePathTransformation.ShellQuote`. The legacy default (`RemotePathTransformation.DoubleQuote`) is unchanged for backwards compatibility. SCP is considered legacy and SFTP, which does not involve a remote shell, is recommended where possible (via `SftpClient`).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "NuGet",
"name" : "SSH.NET"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2026.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sshnet/SSH.NET/security/advisories/GHSA-mggc-4xg6-vcxf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-85756"
}, {
"type" : "WEB",
"url" : "https://github.com/sshnet/SSH.NET/commit/c66b9f8fb06c12e71761e58a577b1e796026310f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sshnet/SSH.NET"
}, {
"type" : "WEB",
"url" : "https://github.com/sshnet/SSH.NET/releases/tag/2026.0.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-17T17:18:01Z",
"nvd_published_at" : "2026-09-16T17:18:16Z"
}
}