CVE-2026-85756 in SSH.NETinfo

Summary

by MITRE • 09/16/2026

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.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 09/16/2026

The vulnerability identified within SSH.NET prior to version 2026.0.0 represents a critical command injection flaw located specifically within the ScpClient component of this Secure Shell library for .NET environments. The core technical deficiency arises from how the library handles remote file path arguments during SCP operations. When an application utilizes ScpClient, it constructs shell commands on the server side to execute the scp binary and transfer files. These constructed commands incorporate caller-supplied remote paths directly into the command string without sufficient sanitization in certain scenarios. The default transformation mechanism employed by the library is RemotePathTransformation.DoubleQuote, which attempts to secure these inputs by wrapping them in double quotes. However this approach relies on the assumption that double-quoting provides complete protection against shell interpretation, a premise that fails when dealing with complex or maliciously crafted input sequences designed to break out of quoted contexts.

This architectural oversight allows for significant operational impact if an attacker can influence the remote path parameter passed by the host application. If the target server utilizes a shell-based environment where SCP operations are executed via a command interpreter, and if the provided path contains specific shell metacharacters that remain unneutralized by the active transformation logic, these characters will be interpreted by the shell rather than treated as literal file system identifiers. Consequently an attacker who controls part of the remote path can inject arbitrary commands into the execution context. These injected commands are then executed with the privileges of the authenticated SSH user associated with the session. This effectively transforms a standard file transfer operation into a vector for Remote Code Execution, potentially granting the attacker full control over the server environment depending on the permissions of the compromised account.

The exploitability of this vulnerability is contingent upon specific environmental conditions that must align for successful exploitation to occur. First and foremost the target SSH server must be configured or implemented in a manner that relies on shell-based execution for SCP operations rather than using internal implementations that bypass the system shell entirely. Furthermore, the attacker must possess knowledge of the specific parsing rules governing the remote command interpreter involved. Paths crafted specifically to exploit these parsing nuances can successfully escape the protective quoting mechanisms provided by the default transformation. It is important to note that systems utilizing SftpClient are not affected by this issue because SFTP operates over a dedicated binary protocol and avoids invoking external shell commands for file transfers, thereby eliminating the attack surface associated with command injection through path manipulation.

To mitigate this risk organizations must prioritize upgrading SSH.NET to version 2026.0.0 or later where these input validation flaws have been addressed. For environments that cannot immediately upgrade, alternative mitigation strategies include ensuring that any application logic interacting with ScpClient strictly validates and sanitizes remote paths against a whitelist of allowed characters before passing them to the library. Additionally developers should consider switching from SCP operations to SFTP for file transfers whenever possible as this protocol inherently avoids shell-based execution contexts. If SCP must be used, explicitly configuring RemotePathTransformation.ShellQuote may offer improved protection for POSIX-compliant shells by employing more robust quoting mechanisms tailored to those specific environments although relying on transformation logic alone is less secure than upgrading the library itself or avoiding shell-invoking protocols entirely.

From a classification perspective this vulnerability aligns with CWE-78 Improper Neutralization of Special Elements used in an OS Command commonly known as Operating System Command Injection. The attack vector corresponds to ATT&CK technique T1059 Command and Scripting Interpreter where adversaries leverage system utilities or interpreters to execute malicious code. Understanding these classifications helps security teams contextualize the severity within broader threat landscapes emphasizing that input validation failures leading to command injection remain a persistent high-risk category in network service libraries. The resolution underscores the importance of rigorous input handling practices in cryptographic and communication libraries ensuring that assumptions about quoting safety are validated against actual shell parsing behaviors rather than theoretical expectations.

Responsible

GitHub M

Reservation

09/04/2026

Disclosure

09/16/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!