NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

GHSA-p4h8-56qp-hpgv: SSH/SCP option injection allowing local RCE in @aiondadotcom/mcp-ssh

highCVSS 4.0 8.7

@aiondadotcom/mcp-ssh before 1.3.5 passes the `hostAlias` argument to `ssh` and `scp` without an argument terminator. A value like `-oProxyCommand=...` makes SSH run that command locally. A prompt-injected AI agent can trigger it. Fixed in 1.3.5, with no workaround.

Published Apr 14, 2026 · Analysis Oct 30, 2026

What an attacker can do

SSH treats any argument that starts with - as an option, wherever it appears. A hostAlias such as -oProxyCommand=... therefore ran the attacker's command on the machine hosting the MCP server, before any network connection was made. That skipped the documented protection of the # @password: annotations. The process can read local SSH keys, browser cookies, other MCP servers' credentials and anything else the user can read.

On Windows there was a second route. The server used spawn(..., { shell: true }) so ssh.exe and scp.exe were found on PATH. That re-parses every argument through cmd.exe, so &, |, ^, >, quotes or ; in hostAlias, command, localPath or remotePath could run commands.

The server runs locally over STDIO, but the model driving it is not trusted. Tool arguments can be steered by text the model reads: web pages, e-mails, repository files or output from other MCP servers. No malicious user is needed.

Who is affected

npm @aiondadotcom/mcp-ssh before 1.3.5, on all platforms, with extra exposure on Windows. Check:

npm ls -g @aiondadotcom/mcp-ssh

If you run it through npx, check the version your MCP client config resolves.

@aiondadotcom/mcp-ssh

Ecosystem
npm
Affected
< 1.3.5
Fixed in
1.3.5
Check
npm ls @aiondadotcom/mcp-ssh

How to fix it

Upgrade to 1.3.5:

npm install -g @aiondadotcom/[email protected]

The release adds -- to every ssh and scp call, a strict hostAlias whitelist that rejects a leading - and shell metacharacters, and a check that each alias exists in ~/.ssh/config (including Include files) or ~/.ssh/known_hosts. On Windows it resolves ssh.exe and scp.exe to absolute paths and uses shell: false. The advisory lists no workaround.

How to tell if you were hit

Look in MCP tool-call logs for hostAlias values that start with - or contain ProxyCommand, &, | or ;. Check for ssh or scp child processes with -o options that nobody typed, and for processes spawned by them. Beam records agent shell commands and MCP tool calls, and its rules can flag risky ones.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

A crafted hostAlias argument such as -oProxyCommand=... was passed to ssh/scp without an argument terminator. SSH interprets arguments starting with - as options regardless of position, so the option-injection caused SSH to execute the attacker-supplied ProxyCommand locally on the machine running the MCP server — before any network connection. This bypassed the documented protection of # @password: annotations and exposed local SSH keys, browser cookies, other MCP server credentials, and anything else readable by the server process.

A second local-RCE vector existed on Windows: spawn(..., { shell: true }) was used so that ssh.exe/scp.exe could be found via PATH. With shell: true, every argument is re-parsed by cmd.exe, so shell metacharacters (&, |, ^, >, ", ;, …) in hostAlias, command, localPath or remotePath would have been interpreted by cmd.exe and could have triggered arbitrary local command execution on Windows.

The MCP server runs locally over STDIO, but the LLM driving it is not trusted: its tool arguments can be steered by prompt injection from any untrusted text the LLM ingests (web pages, e-mails, repository files, output of other MCP servers). The attack does not require a malicious user — only that the LLM ingests attacker-controlled text at any point during the session.

Patches

Fixed in 1.3.5.

  • Add -- argument terminator to all ssh/scp invocations.
  • Strict whitelist for hostAlias (rejects leading - and shell metacharacters).
  • Known-host check: every hostAlias must be defined in ~/.ssh/config (including Include directives) or present in ~/.ssh/known_hosts.
  • Resolve ssh.exe/scp.exe to absolute paths and use shell: false everywhere on Windows.

Workarounds

None. Upgrade to 1.3.5.

Credit

Reported by Pico (@piiiico) as part of an MCP server security audit.

Questions

Does the attacker need to be a user of the MCP server?

No. The advisory says only that the LLM ingests attacker-controlled text during the session, which can steer the tool arguments.

Is there a workaround?

The advisory says none. Upgrade to 1.3.5.

Does this need a network connection to a target host?

No. The ProxyCommand ran locally before SSH made any connection.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries