wonderwhy-er DesktopCommanderMCP Command Injection Vulnerability in CommandManager Function
Vulnerability
A critical vulnerability allowing OS command injection has been identified in wonderwhy-er DesktopCommanderMCP versions through 0.2.13. The issue arises in the CommandManager function within the file src/command-manager.ts. The vulnerability can be exploited remotely by bypassing the application's command blocklist. This is achieved by using shell command substitution syntax, such as '$(...) or backticks, to nest blocked commands within allowed ones. As a result, an attacker could execute arbitrary commands on the server, depending on the user's privileges.
Impact
Exploitation of this vulnerability allows for arbitrary command execution on the server, with the impact varying based on the privileges of the user running the application.
Reproduction
To reproduce this vulnerability, set up DesktopCommanderMCP with an MCP Client. Then, send a command that includes a blocked command, such as 'iptables', nested within an allowed command, like 'echo'. The application should block the 'iptables' command, but due to the vulnerability, it will be executed instead.
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.
