CVE-2025-62801: Fastmcp FastMCP Vulnerable To Windows Command Vulnerability

MODERATE
Advisory Identifier: GHSA-rj5c-58rq-j5g5
CWE-78
Published
Advisory Summary

CVE-2025-62801 is a MODERATE fastmcp vulnerable to windows command vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Fastmcp libraries in the PyPI ecosystem. The issue involves fastmcp vulnerable to windows command injection in fastmcp cursor installer via server_name. Remediation is available by upgrading affected packages to version 2.13.0.

CVE-2025-62801 at a Glance

CVE Identifier CVE-2025-62801
GHSA Identifier GHSA-rj5c-58rq-j5g5
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Fastmcp
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-62801

To remediate this vulnerability, upgrade all affected Fastmcp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

fastmcp fixed: 2.13.0
pip install fastmcp>=2.13.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show fastmcp

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-62801, inspect your installed packages using pip:

pip show fastmcp

Analyze the terminal output to locate any version of Fastmcp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.13.0), your application is affected.

Note: The pip show fastmcp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Fastmcp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 <deeplink>. 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.

CVE-2025-62801 Affected Fastmcp Versions

1 component(s)
Fixed Versions:
2.13.0
Product / Package Ecosystem Affected Versions Fixed Version
fastmcp
PyPI
< 2.13.0
2.13.0

References

Frequently Asked Questions

What is CVE-2025-62801?
CVE-2025-62801 is a security vulnerability in Fastmcp involving FastMCP vulnerable to windows command injection in FastMCP Cursor installer via server_name under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Fastmcp versions are affected?
Affected versions include releases prior to 2.13.0 across affected packages: fastmcp.
What version fixes CVE-2025-62801?
Upgrading to 2.13.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastmcp affected?
Yes, fastmcp is affected in releases prior to 2.13.0. Upgrade your dependency to 2.13.0 or later.
What CWE is associated with CVE-2025-62801?
CVE-2025-62801 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2025-62801?
Run the dependency tree command: 'pip show fastmcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rj5c-58rq-j5g5",
  "modified" : "2025-10-29T15:39:03Z",
  "published" : "2025-10-29T15:39:03Z",
  "aliases" : [ "CVE-2025-62801" ],
  "summary" : "FastMCP vulnerable to windows command injection in FastMCP Cursor installer via server_name",
  "details" : "### Summary\nA 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\n\n### Details\n1. generate_cursor_deeplink(server_name, …) embeds server_name verbatim in a cursor://…?name= query string.\n2. open_deeplink() is invoked with shell=True only on Windows. That calls cmd.exe /c start <deeplink>.\n3. Any cmd metacharacter inside server_name (&, |, >, ^, …) escapes the start command and spawns an attacker-chosen process.\n\n### PoC\nserver.py \n```\n\nimport random\nfrom fastmcp import FastMCP\n\nmcp = FastMCP(name=\"test&calc\")\n\n@mcp.tool\ndef roll_dice(n_dice: int) -> list[int]:\n    \"\"\"Roll `n_dice` 6-sided dice and return the results.\"\"\"\n    return [random.randint(1, 6) for _ in range(n_dice)]\n\nif __name__ == \"__main__\":\n    mcp.run()\n```\n\nthen run in the terminal:\n`fastmcp install cursor server.py`\n\n### Impact\nOS Command / Shell Injection (CWE-78)\nEvery Windows host that runs fastmcp install cursor is at risk. Developers on their local workstations, CI/CD agents and corporate build machines alike.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "fastmcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.13.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jlowin/fastmcp/security/advisories/GHSA-rj5c-58rq-j5g5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62801"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jlowin/fastmcp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-29T15:39:03Z",
    "nvd_published_at" : "2025-10-28T22:15:37Z"
  }
}