Elgentos Magento2-Dev-Mcp Command Injection Vulnerability

Vulnerability

A command injection vulnerability exists in Elgentos Magento2-Dev-Mcp versions through 1.0.2. The issue arises in the 'executeMagerun2Command' function within 'src/index.ts', where user-controlled input is improperly sanitized before being executed as a command. This vulnerability can be exploited locally, with the injected commands running under the same privileges as the MCP server process.

Impact

Exploitation of this vulnerability allows for arbitrary command execution on the server hosting the MCP service, potentially leading to unauthorized access, data manipulation, or changes to the server environment, depending on the privileges of the MCP server process.

Reproduction

To reproduce this vulnerability, first ensure that 'n98-magerun2' is installed and accessible in the system path. Then, upload a malicious payload using the 'cache-view' tool of the 'magento2-dev-mcp' MCP server. The injected command will be executed with the same privileges as the MCP server process.

Remediation

A patch for this vulnerability has been applied and is available in the 'elgentos/magento2-dev-mcp' repository.

Added: Apr 5, 2026, 11:20 PM
Updated: Apr 5, 2026, 11:20 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
4.6
remediation
0.0
relevance
5.3
threat
6.4
urgency
2.9
incentive
0.0

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