{"id":"CVE-2026-85756","aliases":["GHSA-mggc-4xg6-vcxf"],"url":"https://o3.security/vulnerability/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`).","published":"2026-09-16T16:31:24.630Z","modified":"2026-10-28T02:31:11.393853550Z","cvss":{"score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"NuGet","name":"SSH.NET","fixedVersion":"2026.0.0"}],"fix":{"url":"https://github.com/sshnet/SSH.NET/commit/c66b9f8fb06c12e71761e58a577b1e796026310f","label":"sshnet/SSH.NET@c66b9f8"},"references":[{"type":"WEB","url":"https://github.com/sshnet/SSH.NET/releases/tag/2026.0.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/85xxx/CVE-2026-85756.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/sshnet/SSH.NET/commit/c66b9f8fb06c12e71761e58a577b1e796026310f"},{"type":"PACKAGE","url":"https://github.com/sshnet/SSH.NET"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:31:11.393853550Z"}}