Vulnerability GHSA-4jx9-2fwj-pg4j
Summary
mcp-ssh-manager: Command injection in database helpers (ssh_db_list / ssh_db_dump / ssh_db_import)
Details
Impact
Every ssh_db_* tool argument — database, table, collection, output/input file paths, and the user / host / port / password connection fields — arrives from tool-call parameters and was interpolated directly into a shell-evaluated command string in src/database-manager.js. A caller able to invoke a database tool with a crafted value ($(...), backticks, ; cmd, | cmd, && cmd, bare > file) achieves arbitrary command execution on the configured SSH target, under the account the MCP server uses.
The strongest path is ssh_db_list: it is documented and classified as read-only, so it remained allowed in the readonly and restricted per-server security modes while still reaching an injectable builder — bypassing the boundary those modes are meant to enforce. ssh_db_dump / ssh_db_import are blocked in readonly but remain injectable in the default unrestricted mode.
The earlier v3.6.5 fix (#44) only hardened ssh_db_query's query text via a single-quoted heredoc; the list/dump/import/restore builders — and the query builders' connection flags — were not covered.
Patches
Fixed in 3.6.7. A centralized shellQuote() (single-quote wrapping + '\'' escaping) now wraps every interpolated caller-controlled value across all 15 database builders. The MySQL list-tables database is passed as a shell-quoted positional argument instead of an interpolated USE <db> SQL clause.
Workarounds
Upgrade to 3.6.7. If applications cannot upgrade immediately, avoid exposing the ssh_db_* tools (disable the database tool group) and do not rely on readonly / restricted modes to contain a caller that can reach ssh_db_list.
Credits
Responsibly disclosed by Ugur Ozer, Aeon AI Risk Management ( http://airiskmanagement.ca). mcp-ssh-manager thanks them for the private, well-documented report.
Related Vulnerabilities
Other vulnerabilities affecting the same packages