Source: DeepSec Rust-focused direct pass 20260507013924-5f4812745ba339b2.
Severity: HIGH
Confidence: high
File: crates/bashkit/src/builtins/ssh/cmd.rs:520
Slug: rce
Finding
The SFTP command parser treats the attacker-controlled ls argument as a path, then builds a remote command with format!("ls -la {}", path) and sends it to ssh_client.exec.
Unlike SCP/SFTP put / get paths, this path is not shell-escaped. A path containing shell metacharacters such as command separators or command substitution will be interpreted by the remote shell, bypassing the SFTP command subset and executing arbitrary commands on the allowlisted SSH target with the configured credentials.
Suggested Fix
Shell-escape the ls path before interpolation, or add a dedicated list operation to SshHandler that does not go through a shell command string.
Add a regression test that verifies generated SFTP ls commands quote paths with metacharacters.
Source: DeepSec Rust-focused direct pass
20260507013924-5f4812745ba339b2.Severity: HIGH
Confidence: high
File:
crates/bashkit/src/builtins/ssh/cmd.rs:520Slug:
rceFinding
The SFTP command parser treats the attacker-controlled
lsargument as a path, then builds a remote command withformat!("ls -la {}", path)and sends it tossh_client.exec.Unlike SCP/SFTP
put/getpaths, this path is not shell-escaped. A path containing shell metacharacters such as command separators or command substitution will be interpreted by the remote shell, bypassing the SFTP command subset and executing arbitrary commands on the allowlisted SSH target with the configured credentials.Suggested Fix
Shell-escape the
lspath before interpolation, or add a dedicated list operation toSshHandlerthat does not go through a shell command string.Add a regression test that verifies generated SFTP
lscommands quote paths with metacharacters.