{"id":"CVE-2025-64340","aliases":["CVE-2025-64340","GHSA-m8x7-r2rg-vh5g","PYSEC-2026-2475"],"related":[],"kind":"vulnerability","state":"published","title":"FastMCP has a Command Injection vulnerability - Gemini CLI","summary":"FastMCP is the standard framework for building MCP applications. Prior to version 3.2.0, server names containing shell metacharacters (e.g., &) can cause command injection on Windows when passed to fastmcp install claude-code or fastmcp install gemini-cli. These install paths use subprocess.run() with a list argument, but on Windows the target CLIs often resolve to .cmd wrappers that are executed through cmd.exe, which interprets metacharacters in the flattened command string. This issue has been patched in version 3.2.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"FastMCP is the standard framework for building MCP applications. Prior to version 3.2.0, server names containing shell metacharacters (e.g., &) can cause command injection on Windows when passed to fastmcp install claude-code or fastmcp install gemini-cli. These install paths use subprocess.run() with a list argument, but on Windows the target CLIs often resolve to .cmd wrappers that are executed through cmd.exe, which interprets metacharacters in the flattened command string. This issue has been patched in version 3.2.0.","source":"cvelist"},{"lang":"en","text":"Server names containing shell metacharacters (e.g., `&`) can cause command injection on Windows when passed to `fastmcp install claude-code` or `fastmcp install gemini-cli`. These install paths use `subprocess.run()` with a list argument, but on Windows the target CLIs often resolve to `.cmd` wrappers that are executed through `cmd.exe`, which interprets metacharacters in the flattened command string.\n\nPoC:\n```python\nfrom fastmcp import FastMCP\n\nmcp = FastMCP(name=\"test&calc\")\n\n@mcp.tool\ndef roll_dice(n_dice: int) -> list[int]:\n    \"\"\"Roll `n_dice` 6-sided dice and return the results.\"\"\"\n    return [random.randint(1, 6) for _ in range(n_dice)]\n```\n\n```\nfastmcp install claude-code server.py   # or: fastmcp install gemini-cli server.py\n```\n\nOn Windows, this opens Calculator via the `&calc` in the server name.\n\nImpact:\nArbitrary command execution with the privileges of the user running `fastmcp install`. Affects Windows hosts where the target CLI (one of claude, gemini) is installed as a `.cmd` wrapper. Does not affect macOS/Linux, and does not affect config-file-based install targets (cursor, goose, mcp-json).\n\nPatched in #3522 by validating server names to reject shell metacharacters.","format":"markdown","source":"ghsa"},{"lang":"es","text":"FastMCP es el framework estándar para construir aplicaciones MCP. Antes de la versión 3.2.0, los nombres de servidor que contienen metacaracteres de shell (p. ej., &) pueden causar inyección de comandos en Windows cuando se pasan a fastmcp install claude-code o fastmcp install gemini-cli. Estas rutas de instalación usan subprocess.run() con un argumento de lista, pero en Windows las CLI objetivo a menudo se resuelven en wrappers .cmd que se ejecutan a través de cmd.exe, que interpreta los metacaracteres en la cadena de comandos aplanada. Este problema ha sido parcheado en la versión 3.2.0.","source":"nvd"}],"published":"2026-03-31T22:24:15.000Z","modified":"2026-09-10T03:51:00.538Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 3.2.0","status":"affected"}],"vendor":"jlowin","product":"fastmcp","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.2.0"}],"ecosystem":"PyPI","package":"fastmcp","purl":"pkg:pypi/fastmcp","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.2.0"}],"vendor":"jlowin","product":"fastmcp","cpe":"cpe:2.3:a:jlowin:fastmcp:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.2.0"}],"ecosystem":"PyPI","package":"fastmcp","purl":"pkg:pypi/fastmcp","source":"pysec"}],"references":[{"url":"https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-m8x7-r2rg-vh5g","tags":["exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/PrefectHQ/fastmcp/pull/3522","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/jlowin/fastmcp/security/advisories/GHSA-m8x7-r2rg-vh5g","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64340","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/PrefectHQ/fastmcp","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/fastmcp","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-m8x7-r2rg-vh5g","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-03T16:11:50.768Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-64340","url":"https://www.cve.org/CVERecord?id=CVE-2025-64340","licence":"CVE Terms of Use","modified":"2026-04-03T16:12:58.401Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m8x7-r2rg-vh5g","url":"https://github.com/advisories/GHSA-m8x7-r2rg-vh5g","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:00.538Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-64340","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64340","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2475","url":"https://osv.dev/vulnerability/PYSEC-2026-2475","licence":"CC-BY-4.0","modified":"2026-07-13T16:31:55.161Z"}],"updatedAt":"2026-11-25T22:59:12.021Z","epss":{"score":0.00839,"percentile":0.58923,"date":"2026-12-01T12:00:22.000Z"}}