Command Injection Affecting fastmcp package, versions [,2.13.0rc1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.03% (6th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-FASTMCP-13745516
  • published30 Oct 2025
  • disclosed28 Oct 2025
  • creditNil Ash

Introduced: 28 Oct 2025

NewCVE-2025-62801  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade fastmcp to version 2.13.0rc1 or higher.

Overview

fastmcp is a The fast, Pythonic way to build MCP servers and clients.

Affected versions of this package are vulnerable to Command Injection via the server_name field. An attacker can execute arbitrary OS commands by supplying crafted input to this field during the installation process on Windows hosts that run the install cursor functionality.

PoC


import random
from fastmcp import FastMCP

mcp = FastMCP(name="test&calc")

@mcp.tool
def roll_dice(n_dice: int) -> list[int]:
    """Roll `n_dice` 6-sided dice and return the results."""
    return [random.randint(1, 6) for _ in range(n_dice)]

if __name__ == "__main__":
    mcp.run()

References

CVSS Base Scores

version 4.0
version 3.1