Summary
SSH/SCP option injection allowing local RCE in @aiondadotcom/mcp-ssh
Workarounds
None. Upgrade to 1.3.5.
Credit
Reported by Pico (@piiiico) as part of an MCP server security audit.
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.
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Fixed in 1.3.5.
- Add
--argument terminator to allssh/scpinvocations. - Strict whitelist for
hostAlias(rejects leading-and shell metacharacters). - Known-host check: every
hostAliasmust be defined in~/.ssh/config(includingIncludedirectives) or present in~/.ssh/known_hosts. - Resolve
ssh.exe/scp.exeto absolute paths and useshell: falseeverywhere on Windows.
Frequently Asked Questions
- What is GHSA-P4H8-56QP-HPGV? GHSA-P4H8-56QP-HPGV is a high-severity OS command injection vulnerability in @aiondadotcom/mcp-ssh (npm), affecting versions < 1.3.5. It is fixed in 1.3.5. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- Which versions of @aiondadotcom/mcp-ssh are affected by GHSA-P4H8-56QP-HPGV? @aiondadotcom/mcp-ssh (npm) versions < 1.3.5 is affected.
- Is there a fix for GHSA-P4H8-56QP-HPGV? Yes. GHSA-P4H8-56QP-HPGV is fixed in 1.3.5. Upgrade to this version or later.
- Is GHSA-P4H8-56QP-HPGV exploitable, and should I be worried? Whether GHSA-P4H8-56QP-HPGV is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-P4H8-56QP-HPGV is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-P4H8-56QP-HPGV? Upgrade
@aiondadotcom/mcp-sshto 1.3.5 or later.