Two critical vulnerabilities have been identified in FastMCP, a Python component. These vulnerabilities, CVE-2025-64340 (command injection) and CVE-2026-32871 (SSRF & Path Traversal), could allow attackers to execute arbitrary code and access sensitive data. Patches are available for both vulnerabilities.
CVE-2025-64340 has a CVSS score of 6.7 (Medium), indicating a moderate risk, while CVE-2026-32871 has a CVSS score of 9.5 (Critical), representing a high risk of exploitation.
What is FastMCP?
Command Injection Vulnerability in FastMCP Gemini CLI
CVSS 6.7 - Medium severity, impacting confidentiality and integrity.
This vulnerability affects approximately 2.8% of systems running FastMCP.
A command injection vulnerability exists when installing the `claude-code` or `gemini-cli` tools via `fastmcp install`. Server names containing shell metacharacters, such as `&`, can be exploited to execute arbitrary commands on Windows systems due to the use of `.cmd` wrappers.
How to fix CVE-2025-64340 in FastMCP
Patch immediately- 1.Update FastMCP to version 3.2.0 or later.
pip install --upgrade fastmcpVerify with:
pip show fastmcpWorkaround: None
NextGuard automatically flags CVE-2025-64340 if FastMCP appears in any of your monitored projects — no manual lookup required.
SSRF & Path Traversal Vulnerability in FastMCP OpenAPI Provider
CVSS 9.5 - Critical severity, allowing for unauthorized access and potential data exfiltration.
This vulnerability affects approximately 26.8% of systems running FastMCP.
The FastMCP OpenAPI Provider is vulnerable to Server-Side Request Forgery (SSRF) and Path Traversal due to insecure URL handling. Path parameters in OpenAPI specifications are directly substituted into URLs without proper encoding, allowing attackers to bypass API restrictions and access internal endpoints.
How to fix CVE-2026-32871 in FastMCP
Patch immediately- 1.Update FastMCP to version 3.2.0 or later.
pip install --upgrade fastmcpVerify with:
pip show fastmcpWorkaround: None
NextGuard automatically flags CVE-2026-32871 if FastMCP appears in any of your monitored projects — no manual lookup required.
Stay ahead of Python vulnerabilities
Proactively identify and address security risks in your Python projects. Regular vulnerability scanning and dependency updates are essential for maintaining a secure development environment. monitor your python dependencies to ensure you're always protected.
Compare Your DependenciesFrequently asked questions
The vulnerabilities in FastMCP highlight the importance of secure coding practices and regular dependency updates. By promptly applying the available patches, you can significantly reduce your risk of exploitation. See all python vulnerabilities to stay informed about emerging threats.
Related topics