CVE-2026-5603: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-5603 is an OS command injection vulnerability in the elgentos/magento2-dev-mcp Model Context Protocol (MCP) server for Magento 2 development. It affects all versions up to and including 1.0.2, with the root cause located in the executeMagerun2Command function within src/index.ts. The vulnerability was reported on March 11, 2026, and a patch was merged on March 12, 2026; it was publicly disclosed on April 5, 2026. It carries a CVSS v3.1 base score of 5.3 (Medium) and a CVSS v4.0 base score of 4.8 (Medium) (GitHub Advisory, ENISA EUVD).

Technical details

The vulnerability is classified as CWE-77 (Command Injection) and CWE-78 (OS Command Injection). The executeMagerun2Command function in src/index.ts constructs shell command strings by directly interpolating user-supplied MCP tool parameters (such as key, type, path, value, query, vendorNamespace, moduleName, authorName, authorEmail, and others) and executes them via Node.js child_process.execAsync, which invokes a system shell. Because execAsync passes the constructed string to a shell interpreter, specially crafted input containing metacharacters such as ;, &, or | can break out of the intended command context and execute arbitrary additional commands. In MCP environments, LLM-generated tool parameters influenced by external content (prompt injection) may trigger this vulnerability without direct user interaction (GitHub Issue #4, GitHub PR #5).

Impact

Successful exploitation allows a local attacker with low privileges to execute arbitrary OS commands on the host running the MCP server, with the privileges of the MCP server process. This can result in unauthorized access to sensitive data (confidentiality impact), modification of system files or Magento configuration (integrity impact), and potential service disruption (availability impact). In AI-assisted development environments where the MCP server is integrated with LLM agents, prompt injection attacks could indirectly trigger command execution without direct local user interaction, expanding the effective attack surface (GitHub Issue #4, ENISA EUVD).

Exploitability

A proof-of-concept exploit is publicly available as a PDF document attached to the GitHub issue report (GitHub Issue #4). The CVSS v4.0 exploit maturity is rated as "Proof of Concept." The EPSS score is approximately 0.058% (0.000580), indicating a low but non-zero probability of exploitation in the wild. There is no current evidence of active in-the-wild exploitation or threat actor attribution, and the vulnerability is not listed in the CISA KEV catalog (GitHub Advisory, ENISA EUVD).

Exploitation steps

  1. Identify target: Locate a system running elgentos/magento2-dev-mcp version 1.0.2 or earlier, integrated with an AI agent (e.g., Claude, Cursor, Continue.dev) or accessible locally.
  2. Identify vulnerable parameters: Review the MCP server's exposed tools and their parameters — particularly those accepting free-form strings such as key, path, value, query, vendorNamespace, moduleName, authorName, authorEmail, description, storeId, job, or group.
  3. Craft malicious input: Construct a parameter value containing shell metacharacters to inject an additional command. For example, supplying ; id > /tmp/pwned as a parameter value would cause the shell to execute the injected id command after the intended magerun2 command.
  4. Submit via MCP tool call: Invoke the vulnerable MCP tool (e.g., config-set, dev-module-create, or any tool calling executeMagerun2Command) with the crafted parameter through the AI agent interface or directly via the MCP protocol.
  5. Achieve code execution: The executeMagerun2Command function concatenates the malicious input into a shell command string and passes it to child_process.execAsync, causing the injected command to execute with the privileges of the MCP server process (GitHub Issue #4, GitHub PR #5).

Indicators of compromise

  • Process: Unexpected child processes spawned by the Node.js MCP server process (e.g., /bin/sh, /bin/bash, curl, wget, python, nc) with unusual arguments or connections.
  • File System: Unexpected files created in world-writable directories (e.g., /tmp/) by the MCP server process; new or modified cron jobs or scripts owned by the MCP server's service account.
  • Logs: Node.js process logs or system audit logs (auditd) showing execution of unexpected shell commands originating from the magento2-dev-mcp process; shell history entries with injected metacharacters (;, &, |) in magerun2 command strings.
  • Network: Unexpected outbound network connections from the host running the MCP server to external IPs, particularly on non-standard ports, initiated by the Node.js process.

Mitigation and workarounds

Upgrade elgentos/magento2-dev-mcp to version 1.0.3 or later, which includes the fix introduced in commit aa1ffcc0aea1b212c69787391783af27df15ae9d. The patch refactors executeMagerun2Command to accept an argument array (args: string[]) instead of a raw command string, replaces child_process.execAsync with execFile/execFileAsync (which does not invoke a shell), and uses shellQuote for Docker wrapper command strings to prevent metacharacter injection. As an interim measure, restrict local user access to systems running the vulnerable MCP server and apply the principle of least privilege to the MCP server process account. Note that the project has since been marked as abandoned by the maintainer, as magerun2 now offers a built-in MCP server (magerun2 mcp:server:start) (GitHub Commit, GitHub Advisory, elgentos/magento2-dev-mcp).

Community reactions

A community blog post on dev.to explored the vulnerability pattern and discussed why shellQuote alone is insufficient as a mitigation, recommending the use of execFile instead (dev.to post). The vulnerability was picked up by automated CVE tracking feeds including CVEnew on social platforms and threat intelligence aggregators shortly after disclosure. The maintainer responded quickly by merging a GitHub Copilot-assisted fix within one day of the issue being filed, and subsequently marked the project as abandoned in favor of the upstream magerun2 MCP server (GitHub Issue #4, elgentos/magento2-dev-mcp).

Additional resources


Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-gvwc-5hr5-44p8HIGH7.5
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-5jh3-w3fj-6758LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-5v8x-rm7w-m4c7LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-7pqp-3q23-mwr8LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-3qg4-7mq2-gm93MEDIUMN/A
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management