{"id":"GHSA-mggc-4xg6-vcxf","revision":"168733c3f2864da18b2d0cca191b2280","records":[{"revision":"168733c3f2864da18b2d0cca191b2280","observedAt":"2026-10-23T16:01:25.029+00:00","statement":{"source":"osv","id":"GHSA-mggc-4xg6-vcxf","aliases":["CVE-2026-85756"],"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`).","state":0,"publishedAt":"2026-09-17T17:18:01+00:00","modifiedAt":"2026-09-17T17:30:05.8712287+00:00","affected":[{"ecosystem":"NuGet","name":"SSH.NET","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"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"],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/sshnet/SSH.NET/security/advisories/GHSA-mggc-4xg6-vcxf","https://nvd.nist.gov/vuln/detail/CVE-2026-85756","https://github.com/sshnet/SSH.NET/commit/c66b9f8fb06c12e71761e58a577b1e796026310f","https://github.com/sshnet/SSH.NET","https://github.com/sshnet/SSH.NET/releases/tag/2026.0.0"],"sourceUrl":"https://github.com/advisories/GHSA-mggc-4xg6-vcxf","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-mggc-4xg6-vcxf","identifiers":["GHSA-mggc-4xg6-vcxf","CVE-2026-85756"]},"retained":false,"historicalAffected":[]}],"coverage":[]}