Miggo Logo

CVE-2025-52573: iOS Simulator MCP Command Injection allowed via exec API

6

CVSS Score
3.1

Basic Information

EPSS Score
0.30943%
Published
6/26/2025
Updated
6/26/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
ios-simulator-mcpnpm< 1.3.31.3.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability exists because the application uses the Node.js child_process.exec function (via the execAsync promisified wrapper) to execute shell commands. Several tool handlers exposed by the MCP server construct these commands by directly concatenating untrusted user input (e.g., udid, duration, text, file paths) into the command string. This is a classic command injection vulnerability.

An attacker can provide malicious input containing shell metacharacters (e.g., ;, &&, |, $()) as arguments to these tools. When the command string is passed to the shell for execution, the injected characters are interpreted as command separators or substitutions, allowing the attacker to execute arbitrary commands on the host system where the MCP server is running.

The patch addresses this vulnerability comprehensively by:

  1. Replacing all calls to execAsync with a new run helper function that uses execFile with the shell: false option. This ensures that arguments are passed directly to the executable without being interpreted by a shell.
  2. Passing all command arguments as an array, which is the secure practice for execFile and spawn.
  3. Adding the -- argument in command calls to explicitly tell the command-line tool that no more options will follow, and subsequent arguments are positional, preventing misinterpretation of user input that might start with a hyphen.
  4. Introducing strict input validation using regular expressions for parameters like udid, duration, and text to limit the attack surface.

The identified vulnerable functions are the anonymous async handlers for each tool (ui_tap, ui_type, etc.) because they are the entry points that receive the malicious input and perform the unsafe command construction and execution.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

# *omm*n* Inj**tion in M*P S*rv*r T** M*P S*rv*r *t *ttps://*it*u*.*om/jos*u*yo*s/ios-simul*tor-m*p/ is writt*n in * w*y t**t is vuln*r**l* to *omm*n* inj**tion vuln*r**ility *tt**ks *s p*rt o* som* o* its M*P S*rv*r tool ***inition *n* impl*m*nt*ti

Reasoning

T** vuln*r**ility *xists ****us* t** *ppli**tion us*s t** No**.js `**il*_pro**ss.*x**` *un*tion (vi* t** `*x***syn*` promisi*i** wr*pp*r) to *x**ut* s**ll *omm*n*s. S*v*r*l tool **n*l*rs *xpos** *y t** M*P s*rv*r *onstru*t t**s* *omm*n*s *y *ir**tly