AgentbeamBeta
AI agent vulnerability · FastMCP

CVE-2025-62801: FastMCP vulnerable to windows command injection in FastMCP Cursor installer via server_name

mediumCVSS 4.0 5.4GHSA-rj5c-58rq-j5g5

On Windows, fastmcp install cursor in FastMCP before 2.13.0 passes the MCP server_name into a cmd.exe start command, so a name with characters like & runs an attacker-chosen program. Anyone who installs an untrusted server into Cursor on Windows is exposed. Upgrade to fastmcp 2.13.0.

Published Oct 29, 2025 · Analysis Nov 17, 2026

What an attacker can do

generate_cursor_deeplink(server_name, ...) puts server_name unchanged into a cursor:// deeplink as the name query value. open_deeplink() then runs with shell=True on Windows only, which calls cmd.exe /c start with the deeplink. Any cmd metacharacter in server_name, such as &, |, > or ^, ends the start command and starts another process.

The reporter's proof of concept names the server test&calc. Running fastmcp install cursor server.py then launches calc. A real attacker would use a harmful command instead.

The attacker must influence the server name and get a user to run the install command. That can happen when a developer installs a third-party MCP server script. The command runs with that user's rights, on a workstation, CI agent or build machine. The CVSS 4.0 vector reflects local access, low privileges and user action.

Who is affected

pip package fastmcp before 2.13.0, on Windows hosts where fastmcp install cursor is used. The shell=True call is Windows-specific, so other platforms are not affected by this flaw.

pip show fastmcp

fastmcp

Ecosystem
PyPI
Affected
< 2.13.0
Fixed in
2.13.0
Check
pip show fastmcp

How to fix it

Upgrade to fastmcp 2.13.0:

pip install -U "fastmcp>=2.13.0"

The advisory lists no workaround. Until you upgrade, do not run fastmcp install cursor for servers whose name you did not choose, and check the FastMCP(name=...) value for metacharacters first.

How to tell if you were hit

Search shell history and process logs on Windows for cmd.exe /c start cursor:// invocations that are followed by unexpected child processes. Review MCP server scripts for a name argument that contains &, |, > or ^. Check EDR data for processes spawned by python.exe through cmd.exe around the time of an install.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

A command-injection vulnerability lets any attacker who can influence the server_name field of an MCP execute arbitrary OS commands on Windows hosts that run fastmcp install cursor

Details

  1. generate_cursor_deeplink(server_name, …) embeds server_name verbatim in a cursor://…?name= query string.
  2. open_deeplink() is invoked with shell=True only on Windows. That calls cmd.exe /c start .
  3. Any cmd metacharacter inside server_name (&, |, >, ^, …) escapes the start command and spawns an attacker-chosen process.

PoC

server.py


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()

then run in the terminal: fastmcp install cursor server.py

Impact

OS Command / Shell Injection (CWE-78) Every Windows host that runs fastmcp install cursor is at risk. Developers on their local workstations, CI/CD agents and corporate build machines alike.

Credited to nil340.

Questions

Is Linux or macOS affected by CVE-2025-62801?

Not by this flaw. open_deeplink() uses shell=True only on Windows, where it calls cmd.exe /c start.

What triggers the injection?

Running fastmcp install cursor on a server whose server_name contains cmd metacharacters such as &, |, > or ^.

Which version fixes it?

fastmcp 2.13.0. All earlier versions are affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More FastMCP vulnerabilities

All FastMCP entries