{"id":"CVE-2026-85756","aliases":["EUVD-2026-80878","GHSA-mggc-4xg6-vcxf"],"status":"published","title":"SSH.NET: ScpClient allows server-side RCE via default SCP path handling","description":"SSH.NET is a Secure Shell (SSH) library for .NET. Prior to 2026.0.0, ScpClient places caller-supplied remote paths into the command used to run scp on the server, and the default RemotePathTransformation.DoubleQuote transformation cannot safely quote every remote command interpreter. When an application passes an attacker-controlled path to a shell-based server, shell metacharacters not neutralized by the active IRemotePathTransformation can execute commands as the authenticated SSH user. Exploitation requires a shell-based server and a path crafted for that shell's parsing rules; non-shell servers and paths fully neutralized by the selected transformation are not affected. RemotePathTransformation.ShellQuote is available for POSIX shells, while SftpClient avoids a remote shell entirely. This issue is fixed in version 2026.0.0.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00617,"percentile":0.49856,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-78"],"published":"2026-09-16T16:31:24Z","modified":"2026-10-28T02:31:11Z","fixes":[{"ecosystem":"NuGet","package":"SSH.NET","fixed_in":["2026.0.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"NuGet","package":"SSH.NET","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2026.0.0"}]}]},{"source":"osv","ecosystem":"NuGet","package":"SSH.NET","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2026.0.0"}]}],"versions":["2011.12.7","2011.7.29","2011.9.28","2012.12.3","2012.20.12","2012.21.12","2012.3.9","2013.1.27","2013.1.8","2013.4.7","2014.4.6-beta1","2014.4.6-beta2","2016.0.0","2016.0.0-beta1","2016.0.0-beta2","2016.0.0-beta3","2016.1.0","2016.1.0-beta1","2016.1.0-beta2","2016.1.0-beta3","2016.1.0-beta4","2020.0.0","2020.0.0-beta1","2020.0.1","2020.0.2","2023.0.0","2023.0.1","2024.0.0","2024.1.0","2024.2.0","2025.0.0","2025.1.0"]}],"products":[{"vendor":"sshnet","product":"ssh.net"}],"references":[{"url":"https://github.com/sshnet/SSH.NET/security/advisories/GHSA-mggc-4xg6-vcxf","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/sshnet/SSH.NET/commit/c66b9f8fb06c12e71761e58a577b1e796026310f","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/sshnet/SSH.NET/releases/tag/2026.0.0","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85756","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-mggc-4xg6-vcxf"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/85xxx/CVE-2026-85756.json","tags":["advisory"]},{"url":"https://github.com/sshnet/SSH.NET","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-85756","title":"SSH.NET: ScpClient allows server-side RCE via default SCP path handling","description":"SSH.NET is a Secure Shell (SSH) library for .NET. Prior to 2026.0.0, ScpClient places caller-supplied remote paths into the command used to run scp on the server, and the default RemotePathTransformation.DoubleQuote transformation cannot safely quote every remote command interpreter. When an application passes an attacker-controlled path to a shell-based server, shell metacharacters not neutralized by the active IRemotePathTransformation can execute commands as the authenticated SSH user. Exploitation requires a shell-based server and a path crafted for that shell's parsing rules; non-shell servers and paths fully neutralized by the selected transformation are not affected. RemotePathTransformation.ShellQuote is available for POSIX shells, while SftpClient avoids a remote shell entirely. This issue is fixed in version 2026.0.0.","status":"published","published":"2026-09-16T16:31:24.63Z","modified":"2026-09-16T18:34:33.535Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:19:52.773089Z"}],"euvd":[{"id":"EUVD-2026-80878","description":"SSH.NET is a Secure Shell (SSH) library for .NET. Prior to 2026.0.0, ScpClient places caller-supplied remote paths into the command used to run scp on the server, and the default RemotePathTransformation.DoubleQuote transformation cannot safely quote every remote command interpreter. When an application passes an attacker-controlled path to a shell-based server, shell metacharacters not neutralized by the active IRemotePathTransformation can execute commands as the authenticated SSH user. Exploitation requires a shell-based server and a path crafted for that shell's parsing rules; non-shell servers and paths fully neutralized by the selected transformation are not affected. RemotePathTransformation.ShellQuote is available for POSIX shells, while SftpClient avoids a remote shell entirely. This issue is fixed in version 2026.0.0.","status":"published","published":"2026-09-16T16:31:24Z","modified":"2026-09-16T18:34:33Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T17:28:14.682482Z"}],"ghsa":[{"id":"GHSA-mggc-4xg6-vcxf","title":"SSH.NET: ScpClient allows server-side RCE via default SCP path handling","description":"## 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`).","status":"published","published":"2026-09-17T17:18:01Z","modified":"2026-09-17T17:18:02Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:41:18.357514Z"}],"nvd":[{"id":"CVE-2026-85756","description":"SSH.NET is a Secure Shell (SSH) library for .NET. Prior to 2026.0.0, ScpClient places caller-supplied remote paths into the command used to run scp on the server, and the default RemotePathTransformation.DoubleQuote transformation cannot safely quote every remote command interpreter. When an application passes an attacker-controlled path to a shell-based server, shell metacharacters not neutralized by the active IRemotePathTransformation can execute commands as the authenticated SSH user. Exploitation requires a shell-based server and a path crafted for that shell's parsing rules; non-shell servers and paths fully neutralized by the selected transformation are not affected. RemotePathTransformation.ShellQuote is available for POSIX shells, while SftpClient avoids a remote shell entirely. This issue is fixed in version 2026.0.0.","status":"published","published":"2026-09-16T17:18:16.163Z","modified":"2026-09-30T17:51:36.337Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:12:48.630594Z"}],"osv":[{"id":"CVE-2026-85756","title":"SSH.NET: ScpClient allows server-side RCE via default SCP path handling","description":"SSH.NET is a Secure Shell (SSH) library for .NET. Prior to 2026.0.0, ScpClient places caller-supplied remote paths into the command used to run scp on the server, and the default RemotePathTransformation.DoubleQuote transformation cannot safely quote every remote command interpreter. When an application passes an attacker-controlled path to a shell-based server, shell metacharacters not neutralized by the active IRemotePathTransformation can execute commands as the authenticated SSH user. Exploitation requires a shell-based server and a path crafted for that shell's parsing rules; non-shell servers and paths fully neutralized by the selected transformation are not affected. RemotePathTransformation.ShellQuote is available for POSIX shells, while SftpClient avoids a remote shell entirely. This issue is fixed in version 2026.0.0.","status":"published","published":"2026-09-16T16:31:24.63Z","modified":"2026-10-28T02:31:11.39385355Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:45:18.825071Z"},{"id":"GHSA-mggc-4xg6-vcxf","title":"SSH.NET: ScpClient allows server-side RCE via default SCP path handling","description":"## 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`).","status":"published","published":"2026-09-17T17:18:01Z","modified":"2026-09-17T17:30:05.871228652Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:46:51.811331Z"}]}}
