/

CVE-2026-129995

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in mcp-ssh-manager Backups

CVE-2026-129995

Received

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary command execution on managed remote servers

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

mcp-ssh-manager backup tools build remote shell commands using caller-controlled arguments without neutralizing shell metacharacters. If a malicious or compromised MCP client supplies crafted values, commands may execute on managed servers as the configured SSH user; scheduled backups may also create persistent execution.

Affected context

The issue affects backup operations in mcp-ssh-manager, including create, restore, schedule, and list handlers. It becomes risky when caller-controlled values are incorporated into remote shell commands without effective neutralization. The list handler also lacks the server policy check used by other operations, so it may remain available in readonly or restricted modes.

Exploit preconditions

  • Attack surface: MCP backup tools that construct commands for remote execution over SSH
  • Required access: Ability to supply arguments through an MCP client; the attacker may be a malicious or compromised client, or may influence a client through indirect prompt injection
  • Trigger point: A backup tool processes caller-controlled values such as database, connection, directory, path, exclusion, schedule, or comment arguments
  • Why exploitation is possible: Values are incorporated into shell commands without adequate shell metacharacter neutralization
  • Scope and privilege: Commands run on the managed remote server with the configured SSH user's permissions; scheduling may allow execution to persist through cron

Why this happens

Backup command builders incorporate caller-controlled values into shell command strings without safely separating data from command syntax. Shell metacharacters can therefore alter the meaning of the generated command when it is executed remotely. This is CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection. A prior fix in a separate database helper did not cover these parallel backup command builders.

Potential impact

  • Arbitrary commands may execute on a managed remote server as the configured SSH user.
  • Attackers may access or modify files and data available to that account.
  • Scheduled tasks may enable persistent command execution through cron.
  • The list operation may permit command execution even in readonly or restricted modes.
  • Compromised servers may be used to affect other systems accessible to the SSH account.

General mitigation guidance

Common defensive patterns focus on avoiding shell interpretation and consistently enforcing authorization:

  • Prefer APIs that pass commands and arguments directly to the process, without invoking a shell.
  • Where shell use cannot be avoided, use well-tested argument-escaping mechanisms and strict allowlists for values such as paths, identifiers, and schedule fields.
  • Treat every tool argument as untrusted, including values supplied through trusted-looking workflows or natural-language interactions.
  • Apply server-side policy and authorization checks uniformly to every backup operation, including list operations and restricted modes.
  • Run remote operations with least-privilege SSH accounts and limit their access to required files and commands.
  • Keep scheduled jobs constrained, reviewable, and removable through controlled mechanisms.

How teams detect issues like this

  • Use static analysis to identify shell execution APIs and command strings assembled with user-controlled values.
  • Review all backup handlers for consistent argument handling and policy checks, including inline handlers and parallel command builders.
  • Add tests that verify special characters are treated as data and that restricted modes enforce policy across every tool.
  • Use policy enforcement to prohibit shell execution where direct process APIs are available and to require authorization checks for remote operations.
  • Review audit trails and remote host logs for unexpected commands or changes to scheduled tasks.

Sources

SourceLink
github.comgithub.com/bvisible/mcp-ssh-manager/commit/d40daa8a43388dfaedf593bff18f0064d50f9633
github.comgithub.com/bvisible/mcp-ssh-manager/releases/tag/v3.8.5
github.comgithub.com/bvisible/mcp-ssh-manager/security/advisories/GHSA-qwwm-vrm9-4mw8

Frequently asked

questions

It can be triggered through MCP tool arguments that lead to remote command execution over SSH. Exploitation depends on access to an MCP client or the ability to influence its supplied arguments.

An attacker needs a way to submit or influence arguments for an affected backup tool. Resulting commands run with the permissions of the configured SSH user.

Avoid shell command construction and use APIs that pass arguments as separate data. If shell use is unavoidable, strictly validate and safely encode every argument, and apply policy checks consistently.

Treat tool inputs as untrusted, audit all command-building paths, test that restricted modes enforce authorization, and limit the privileges available to remote operations.

Find out what's already
exploitable in your codebase.