PyPI: fastmcp

CVE-2025-64340

Safety vulnerability ID: SFTY-20260331-05667

Safety legacy ID: pyup.io-91320

Affected versions of the fastmcp package are vulnerable to Command Injection due to improper neutralization of shell metacharacters in server names. The fastmcp install claude-code and fastmcp install gemini-cli installation paths pass a server name into subprocess.run(), and on Windows the target CLI may resolve to a .cmd wrapper executed through cmd.exe, which interprets metacharacters such as & in the flattened command string.

Created at: Apr 21, 2026Updated at: Apr 21, 2026

Overview

FastMCP has a Command Injection vulnerability - Gemini CLI

Advisory

Affected versions of the fastmcp package are vulnerable to Command Injection due to improper neutralization of shell metacharacters in server names. The fastmcp install claude-code and fastmcp install gemini-cli installation paths pass a server name into subprocess.run(), and on Windows the target CLI may resolve to a .cmd wrapper executed through cmd.exe, which interprets metacharacters such as & in the flattened command string.

Affected Package

Affecting fastmcp package, versions
<3.2.0

Also affects

---

How to Fix

Upgrade
fastmcp
to
3.2.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more