CVE-2026-48711 in Sshfs
Summary
by MITRE • 08/19/2026
SSHFS is a network filesystem client for connecting to SSH servers. From version 1.4 until 3.7.6, SSHFS accepts a bracketed mount source such as [-oProxyCommand=CMD]:/path and find_base_path() removes the brackets, leaving a host value that begins with - and is passed directly to ssh as a command-line argument. When a caller also supplies a path-valued sftp_server, ssh treats the normalized host as an option and the server path as its destination, causing an injected ProxyCommand to execute locally before any connection or authentication succeeds. The attack requires a caller or wrapper that passes an attacker-controlled mount source to SSHFS with the required sftp_server configuration and results in arbitrary command execution as the user running SSHFS. This issue is fixed in version 3.7.6.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 08/19/2026
The vulnerability identified within SSHFS versions ranging from 1.4 through 3.7.6 represents a critical remote code execution flaw rooted in improper input validation and argument parsing logic. SSHFS functions as a network filesystem client that allows users to mount directories on an SSH server, effectively treating them as local file systems. The core of the vulnerability lies in how the application processes the mount source string provided by the user or calling wrapper. Specifically, when a bracketed syntax is used for the host specification, such as [-oProxyCommand=CMD]:/path, the internal function find_base_path() strips away the surrounding brackets to normalize the input. However, this normalization process fails to adequately sanitize the resulting host value if it begins with a hyphen character. Consequently, the application passes this malformed host string directly to the underlying ssh command-line utility without verifying whether the leading hyphen indicates an option flag rather than a hostname.
This technical flaw creates a severe security gap because the SSH client interprets any argument starting with a dash as a configuration option or switch. When an attacker controls the mount source and ensures it begins with a hyphen, they can inject arbitrary command-line arguments into the ssh invocation. The exploitation scenario becomes particularly potent when combined with specific configurations where the caller also supplies a path-valued sftp_server parameter. In this context, the SSH client misinterprets the injected host string as an option flag and treats the subsequent sftp_server value not as a server specification but as the argument or destination for that injected option. This parsing error allows the attacker to inject a ProxyCommand directive into the ssh command line. The ProxyCommand is executed locally by the shell before any network connection attempt or authentication handshake takes place, effectively bypassing all security controls associated with SSH authentication and encryption.
The operational impact of this vulnerability is significant, as it results in arbitrary code execution on the target system under the context of the user running the SSHFS process. This means that if an application wrapper passes attacker-controlled input to SSHFS without rigorous sanitization, a malicious actor can achieve full command execution privileges equivalent to those of the invoking user. The attack does not require network access to the remote SSH server for initial exploitation; rather, it relies on local processing errors within the client-side toolchain. This characteristic makes the vulnerability particularly dangerous in environments where automated scripts or services interact with external inputs to determine mount points, as even a single instance of unsanitized input can lead to complete system compromise. The flaw is classified under CWE-78 Improper Neutralization of Special Elements used in an OS Command and aligns with ATT&CK technique T1059 Command and Scripting Interpreter, specifically reflecting the abuse of command-line arguments for code injection.
Mitigation strategies must focus on both immediate patching and long-term defensive coding practices. The primary remediation is to upgrade SSHFS to version 3.7.6 or later, where this parsing logic has been corrected to properly validate host strings regardless of leading characters. For environments unable to immediately update the software, administrators should implement strict input validation at the application layer before passing any mount source parameters to SSHFS. This includes ensuring that hostnames do not begin with hyphens and rejecting any input containing bracketed syntax unless it is explicitly handled by a secure parser. Additionally, adopting least-privilege principles for users running filesystem mounting operations can limit the blast radius of such an exploit. Security teams should also monitor system logs for unusual ssh command invocations that include ProxyCommand directives or unexpected argument patterns to detect potential exploitation attempts in real time.