PyPI: fastmcp
CVE-2026-32871
Safety vulnerability ID: SFTY-20260331-24057
Safety legacy ID: pyup.io-91326
Affected versions of the fastmcp package are vulnerable to Server-Side Request Forgery (SSRF) and Path Traversal due to improper path parameter handling in URL construction. Specifically, fastmcp/utilities/openapi/director.py implements RequestDirector._build_url() by directly substituting untrusted path parameter values into path_template without URL-encoding, then passing the result to urllib.parse.urljoin(), which normalizes dot-dot-slash traversal sequences and allows the final request path to escape the intended API prefix.
Overview
FastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerability
Advisory
Affected versions of the fastmcp package are vulnerable to Server-Side Request Forgery (SSRF) and Path Traversal due to improper path parameter handling in URL construction. Specifically, fastmcp/utilities/openapi/director.py implements RequestDirector._build_url() by directly substituting untrusted path parameter values into path_template without URL-encoding, then passing the result to urllib.parse.urljoin(), which normalizes dot-dot-slash traversal sequences and allows the final request path to escape the intended API prefix.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260331-24057/CVE-2026-32871
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-32871
- https://data.safetycli.com/changelogs/fastmcp/
- https://github.com/advisories/GHSA-vv7q-7jx5-f767
- https://pypi.org/project/fastmcp
- https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-vv7q-7jx5-f767
- https://nvd.nist.gov/vuln/detail/CVE-2026-32871
- https://github.com/PrefectHQ/fastmcp/pull/3507
- https://github.com/PrefectHQ/fastmcp/commit/40bdfb6b1de0ce30609ee9ba5bb95ecd04a9fb71
- https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.0
- https://github.com/advisories/GHSA-vv7q-7jx5-f767
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
