mcp-ssh-manager: Command injection in database helpers (ssh_db_list / ssh_db_dump / ssh_db_import)GHSA-4jx9-2fwj-pg4j
Fix: bvisible/mcp-ssh-manager#51GHSA-4jx9-2fwj-pg4j is a OS Command Injection vulnerability in mcp-ssh-manager. A fix is available for mcp-ssh-manager — see the affected versions and patch details below.
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-4jx9-2fwj-pg4j.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
mcp-ssh-managerReal-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
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | mcp-ssh-manager | all versions | 3.6.7npm install mcp-ssh-manager@3.6.7 |
Detection & mitigation playbook
Open-source dependencyDetect
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.
Fix
Update mcp-ssh-manager to 3.6.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4jx9-2fwj-pg4j is resolved across your whole dependency graph.
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
Is GHSA-4jx9-2fwj-pg4j in your dependencies?
Find it across npm, including transitive dependencies.