# CVE-2025-64340: FastMCP has a Command Injection vulnerability - Gemini CLI

> An attacker can execute arbitrary commands on Windows by providing server names with shell metacharacters during FastMCP installation.

- **Severity:** Medium 6.7 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 3 Apr 2026
- **Updated:** 3 Apr 2026
- **Also known as:** CLSA-2026-1781139162, ECHO-8490-867c-f16b, GHSA-m8x7-r2rg-vh5g, PYSEC-2026-2475, ROOT-APP-PYPI-CVE-2025-64340

## What is CVE-2025-64340?

CVE-2025-64340 is a medium-severity command injection vulnerability in jlowin fastmcp, published on 3 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2025-64340?

3 open source packages ship an affected version, including fastmcp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `fastmcp` | PyPI | All versions | 3.2.0 |
| `fastmcp` | PyPI | All versions | 3.2.0 |
| `fastmcp` | PyPI | All versions | 3.2.0 |

Products: Jlowin Fastmcp.

## How do I fix CVE-2025-64340?

Upgrade fastmcp to 3.2.0 or later.

## Is CVE-2025-64340 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-64340 exists.

## Other vulnerabilities in jlowin fastmcp

- [CVE-2026-32871](https://insights.sbomify.com/CVE-2026-32871/): FastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerability (critical 10.0)
- [CVE-2026-27124](https://insights.sbomify.com/CVE-2026-27124/): FastMCP: Missing Consent Verification in OAuth Proxy Callback Facilitates Confused Deputy Vulnerabilities (high 8.2)
- [CVE-2025-69196](https://insights.sbomify.com/CVE-2025-69196/): FastMCP OAuth Proxy token reuse across MCP servers (high 7.4)
- [CVE-2025-62801](https://insights.sbomify.com/CVE-2025-62801/): FastMCP vulnerable to windows command injection in FastMCP Cursor installer via server_name (medium 5.4)
- [CVE-2025-62800](https://insights.sbomify.com/CVE-2025-62800/): FastMCP vulnerable to reflected XSS in client's callback page (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-64340 and fix it if it is affected.

What it is: CVE-2025-64340 is a medium-severity command injection vulnerability in jlowin fastmcp, published on 3 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-64340 exists.

Affected packages and fixed versions:
- fastmcp (PyPI): affected all versions; fixed in 3.2.0
- fastmcp (PyPI): affected all versions; fixed in 3.2.0
- fastmcp (PyPI): affected all versions; fixed in 3.2.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-64340/ (Markdown: https://insights.sbomify.com/CVE-2025-64340/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-64340
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-64340
- OSV: https://osv.dev/vulnerability/CVE-2025-64340

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-64340/
Summaries are generated and may contain mistakes; the official description above is the record.
