Executive brief
FastMCP is a Python library used to build Model Context Protocol (MCP) servers and clients, which allow AI models to interact with external tools and data. A security flaw in how the library handles web API requests allows an attacker to bypass intended security boundaries and access restricted internal systems. This could lead to unauthorized access to sensitive backend data or the execution of administrative actions using the server's own credentials.
Technical details
A path traversal vulnerability exists in the RequestDirector._build_url() method of FastMCP's OpenAPIProvider. When processing OpenAPI operations, the library substitutes path parameter values directly into URL templates without performing URL-encoding. Because the final URL is resolved using urllib.parse.urljoin(), an attacker can provide input containing '../' sequences to traverse out of the intended API path. This enables authenticated Server-Side Request Forgery (SSRF), as the resulting requests are sent to arbitrary backend endpoints using the authorization headers configured in the MCP provider. The issue is fixed in version 3.2.0 by applying percent-encoding to all path parameters.
Affected products
- PrefectHQ fastmcp < 3.2.0
Timeline
- 2026-03-15: patched: Fix merged into main branch
- 2026-03-30: advisory: Version 3.2.0 released with security hardening
- 2026-04-02: disclosed: CVE-2026-32871 published
References
- https://github.com/PrefectHQ/fastmcp/commit/40bdfb6b1de0ce30609ee9ba5bb95ecd04a9fb71
- https://github.com/PrefectHQ/fastmcp/pull/3507
- https://github.com/PrefectHQ/fastmcp/releases/tag/v3.2.0
- https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-vv7q-7jx5-f767
- https://access.redhat.com/security/cve/CVE-2026-32871
- https://bugzilla.redhat.com/show_bug.cgi?id=2454434
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32871.json