Friday, 4 December 2026
4 agent hacks today▼ 3 vs yesterday (7)

Command injection flaw found in mcp-ssh-manager database tools

A read-only tool in the npm package let callers run arbitrary commands on SSH targets, breaking the boundary its security modes were meant to enforce.

By The Agentic Times ·

A padlocked vault door swings open as invisible hands reach through its frame, manipulating gears inside a machine that was supposed to remain untouchable.
A padlocked vault door swings open as invisible hands reach through its frame, manipulating gears inside a machine that was supposed to remain untouchable. · Illustration: The Agentic Times

A command injection vulnerability in mcp-ssh-manager, an npm package that exposes SSH actions as Model Context Protocol tools, allowed arbitrary command execution on configured SSH targets, according to a GitHub security advisory published on 30 November 2026. The flaw is tracked as CVE-2026-77383 and GHSA-4jx9-2fwj-pg4j. It has been fixed in version 3.6.7.

According to the advisory, every argument to the package's ssh_db_* database helper tools arrived from tool-call parameters and was interpolated directly into a shell-evaluated command string in src/database-manager.js. That included the database, table and collection names, output and input file paths, and the user, host, port and password connection fields. A caller able to invoke a database tool with a crafted value — using constructs such as $(...), backticks, ; cmd, | cmd, && cmd or a bare > file — could achieve arbitrary command execution on the SSH target, running under the account the MCP server uses.

The advisory describes ssh_db_list as the strongest path for an attacker. Because the tool is documented and classified as read-only, it remained allowed in the readonly and restricted per-server security modes, while still reaching an injectable command builder. That meant the vulnerability bypassed the boundary those modes are meant to enforce. The ssh_db_dump and ssh_db_import tools are blocked in readonly mode, but the advisory says they remained injectable in the default unrestricted mode.

The issue was not fully addressed by earlier work on the package. According to the advisory, a fix in version 3.6.5 hardened only the query text passed to ssh_db_query, using a single-quoted heredoc. The list, dump, import and restore builders were not covered, and neither were the connection flags used by the query builders.

The maintainers say version 3.6.7 introduces a centralised shellQuote() function that wraps interpolated caller-controlled values in single quotes and escapes embedded quotes using the '\'' sequence. The advisory says this is now applied across all 15 database command builders. The MySQL list-tables operation has also been changed: the database name is passed as a shell-quoted positional argument rather than being interpolated into a USE <db> SQL clause.

For users who cannot update immediately, the advisory recommends avoiding exposure of the ssh_db_* tools by disabling the database tool group. It also warns operators not to rely on the readonly or restricted modes to contain any caller that can reach ssh_db_list.

The class of problem is a familiar one for MCP servers, which turn natural-language tool calls into real system commands. Where arguments flow from a model's output straight into a shell, any value the model can be persuaded to produce becomes an executable instruction. The advisory's description makes the gap explicit: a tool labelled read-only was trusted by the package's own permission layer, even though the code behind it could write and execute.

The advisory says the issue was responsibly disclosed by Ugur Ozer of Aeon AI Risk Management, and thanks the reporter for a private, well-documented report. The vulnerability is recorded as resolved.

Sources

  1. github.comhttps://github.com/advisories/GHSA-4jx9-2fwj-pg4j