Tufantunc SSH-MCP Command Injection Vulnerability in Versions Prior to 1.5.0
Vulnerability
A command injection vulnerability has been identified in Tufantunc SSH-MCP versions prior to 1.5.0. The issue arises in the 'shell.write' function within 'src/index.ts', where the 'description' parameter is manipulated, leading to the execution of arbitrary commands as root. This vulnerability is exploited locally when the 'su' mode is active, allowing attacker-controlled commands to be executed with elevated privileges.
Impact
Exploitation of this vulnerability allows for arbitrary command execution as the root user, posing a significant privilege escalation risk.
Reproduction
To reproduce this vulnerability, first ensure that the SSH-MCP server is running with 'su' mode enabled. This can be done by starting the server with the '--suPassword' option. Once the server is running, use an MCP client to send a command execution request through the 'exec' tool, including a 'description' parameter that contains newline characters. The injected commands will be executed in the root shell session, demonstrating the command injection flaw.
Remediation
Users are advised to update to SSH-MCP version 1.5.0 or later, where this vulnerability has been addressed.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
