Hey — I reviewed mcp-ssh-manager's permission surface and wanted to flag some things. This is one of the highest-risk MCP server categories (remote shell access to production infrastructure), so the findings here are more about hardening than bugs.
TL;DR
37 tools give an agent unrestricted SSH access including arbitrary command execution, sudo escalation, file transfers, SOCKS proxy tunneling, and multi-server group execution. There are no command filters, path restrictions, or approval gates. A prompt injection could execute commands across an entire server fleet in a single tool call.
Top Findings
1. Unrestricted remote command execution (CRITICAL)
ssh_execute passes any command string to the remote server with zero filtering. ssh_execute_group amplifies this across all servers simultaneously. No allowlist, no blocklist, no approval step.
2. Sudo with stored passwords (CRITICAL)
ssh_execute_sudo accepts a password parameter directly from the agent, or uses a password stored in plaintext in .env. The password is passed via echo "$password" | sudo -S, which exposes it in the process list. The agent gets root access with no confirmation.
3. SSH tunneling including SOCKS proxy (CRITICAL)
ssh_tunnel_create supports local, remote, and dynamic (SOCKS5) forwarding with no restrictions on destination hosts/ports. An agent could set up a SOCKS proxy and route traffic through any server, or expose internal services to external networks.
4. Unrestricted file transfers (HIGH)
ssh_upload, ssh_download, and ssh_sync have no path restrictions. An agent can download /etc/shadow, SSH keys, or any file — and upload backdoors to any location.
5. SQL injection bypass in ssh_db_query (MEDIUM)
The isSafeQuery() function uses keyword matching that's bypassable — SELECT LOAD_FILE('/etc/passwd') passes the check. MongoDB queries have no validation at all, allowing arbitrary JS execution.
Suggestions
- Command allowlist/blocklist — at minimum block
rm -rf, dd, mkfs, shutdown
- Remove direct password parameters from sudo tools — don't let the agent handle credentials
- Path restrictions for file transfers — block access to
.ssh/, /etc/shadow, etc.
- Tunnel destination allowlist — disable SOCKS by default
- Approval gate for
ssh_execute, ssh_execute_sudo, ssh_execute_group
- Proper SQL parser instead of keyword matching for
isSafeQuery()
Impressive feature set for the tool. These are hardening suggestions given the risk level of remote SSH access in agent workflows.
Found using AgentWard — open-source permission control plane for AI agents.
Hey — I reviewed mcp-ssh-manager's permission surface and wanted to flag some things. This is one of the highest-risk MCP server categories (remote shell access to production infrastructure), so the findings here are more about hardening than bugs.
TL;DR
37 tools give an agent unrestricted SSH access including arbitrary command execution, sudo escalation, file transfers, SOCKS proxy tunneling, and multi-server group execution. There are no command filters, path restrictions, or approval gates. A prompt injection could execute commands across an entire server fleet in a single tool call.
Top Findings
1. Unrestricted remote command execution (CRITICAL)
ssh_executepasses any command string to the remote server with zero filtering.ssh_execute_groupamplifies this across all servers simultaneously. No allowlist, no blocklist, no approval step.2. Sudo with stored passwords (CRITICAL)
ssh_execute_sudoaccepts apasswordparameter directly from the agent, or uses a password stored in plaintext in.env. The password is passed viaecho "$password" | sudo -S, which exposes it in the process list. The agent gets root access with no confirmation.3. SSH tunneling including SOCKS proxy (CRITICAL)
ssh_tunnel_createsupports local, remote, and dynamic (SOCKS5) forwarding with no restrictions on destination hosts/ports. An agent could set up a SOCKS proxy and route traffic through any server, or expose internal services to external networks.4. Unrestricted file transfers (HIGH)
ssh_upload,ssh_download, andssh_synchave no path restrictions. An agent can download/etc/shadow, SSH keys, or any file — and upload backdoors to any location.5. SQL injection bypass in
ssh_db_query(MEDIUM)The
isSafeQuery()function uses keyword matching that's bypassable —SELECT LOAD_FILE('/etc/passwd')passes the check. MongoDB queries have no validation at all, allowing arbitrary JS execution.Suggestions
rm -rf,dd,mkfs,shutdown.ssh/,/etc/shadow, etc.ssh_execute,ssh_execute_sudo,ssh_execute_groupisSafeQuery()Impressive feature set for the tool. These are hardening suggestions given the risk level of remote SSH access in agent workflows.
Found using AgentWard — open-source permission control plane for AI agents.