wonderwhy-er DesktopCommanderMCP Command Injection Vulnerability in Absolute Path Handler

Vulnerability

A critical OS command injection vulnerability has been identified in wonderwhy-er DesktopCommanderMCP versions through 0.2.13. The issue arises in the 'extractBaseCommand' function within 'src/command-manager.ts', where the application fails to properly normalize command paths. This oversight allows users to bypass the command blocklist by specifying absolute paths to blocked commands, leading to arbitrary command execution. The vulnerability can be exploited remotely, and its impact varies based on the privileges of the user running the server.

Impact

Exploitation of this vulnerability allows for arbitrary command execution on the server, bypassing established command restrictions. This could lead to unauthorized actions being performed, depending on the privileges of the user executing the commands.

Reproduction

To reproduce this vulnerability, set up DesktopCommanderMCP with an MCP Client. Identify the absolute path of a blocked command, such as 'iptables', and send a request through Desktop Commander that includes the absolute path of the blocked command. The command execution should be allowed, demonstrating the bypass of the blocklist.

Remediation

It is recommended to modify the 'extractBaseCommand' function to normalize command inputs by extracting only the base name of the path, using Node.js's 'path.basename()' function before processing the command.

Added: Oct 8, 2025, 7:19 PM
Updated: Oct 8, 2025, 8:29 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
6.6
remediation
0.0
relevance
0.7
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.