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

Medium 6.7 Published Updated

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

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

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

Which versions are affected by CVE-2025-64340?

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

PackageAffectedFixed in
fastmcp PyPIAll versions3.2.0
fastmcp PyPIAll versions3.2.0
fastmcp PyPIAll versions3.2.0

Products include Jlowin Fastmcp.

How do I fix CVE-2025-64340?

Upgrade fastmcp to 3.2.0 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2025-64340 being exploited?

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

Sources

Also known as CLSA-2026-1781139162, ECHO-8490-867c-f16b, GHSA-m8x7-r2rg-vh5g, PYSEC-2026-2475, ROOT-APP-PYPI-CVE-2025-64340.

Is CVE-2025-64340 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free