High

FastMCP OAuth Proxy token reuse across MCP servers

  • Disclosed: 16.03.2026
  • Updated: 11.10.2026 14:18

While testing the OAuth Proxy implementation, it was noticed that the server does not properly respect the resource parameter submitted by the client in the authorization and token request. Instead of issuing the token explicitly for this MCP server, the token is issued for the base_url passed to the OAuthProxy during initialization.

Affected File: https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L828

Affected Code:

python
self._jwt_issuer: JWTIssuer = JWTIssuer(
    issuer=str(self.base_url),
    audience=f"{str(self.base_url).rstrip('/')}/mcp",
    signing_key=jwt_signing_key,
)

Since the issued access and refresh tokens do not include information about the resource the token was issued for, it is impossible for the MCP server to properly verify whether the token was issued for it, hence violating the requirement of doing so demanded by the specification. Being able to verify whether the token was issued for the target MCP server enforces the protections offered by the steps proposed by the specification and the Resource Indicators OAuth extension.

Therefore, this misconfiguration exposes all MCP server setups using the FastMCP OAuth Proxy to an attack where an adversary creates a malicious MCP server that advertises the benign OAuth Proxy authorization server as its own authorization server. Once a victim completes an OAuth flow with this malicious MCP server, authenticating against the AS, the adversary can extract the token received at the malicious MCP server and use it to access other MCP servers (the benign ones) that also use the same AS, including the tools and resources they expose.

Steps to reproduce:

  1. Extract the provided PoC environment.
  2. Enter the client_id and client_secret of a GitHub App you control into the mcp-server-proxy.py script.
  3. Start the benign MCP server using an OAuth Proxy (in this case the GitHubProvider): python3 mcp-server-proxy.py.
  4. Start the malicious AS: python3 mal_auth_server.py.
  5. Start the malicious MCP server: python3 attacker_server.py.
  6. Connect the client to the malicious MCP server: python3 client.py.
  7. Complete the OAuth flow.
  8. Observe in the logs of the malicious MCP server that the request to the benign MCP server with the stolen token returned a 200 status code.

Impact

This vulnerability allows an adversary to steal a victim’s authentication material for a benign MCP server using the FastMCP OAuth Proxy. The severity of this issue was decreased to Medium due to the consent screen showing the name of the MCP server the OAuth Proxy was intended for. However, a victim might not see it or get otherwise convinced by the attacker to ignore it, and overall this does not act as a proper mitigation for this issue.

Mitigation

To mitigate this vulnerability, it is recommended to issue tokens specifically for the MCP server submitted in the authorization URL’s resource GET parameter. In this way, the receiving MCP server will be able to properly verify that the token was indeed issued for it, allowing it to reject tokens stolen by an attack like the one demonstrated above.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) fastmcp < 2.14.2 2.14.2

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-863
Platform
Python (PyPI)
Package
fastmcp
Disclosed
16.03.2026
Updated
11.10.2026 14:18

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-2474 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-5h2m-4q8j-pqpj - CC BY 4.0

Vulnerability history: fastmcp

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
8
First → latest
10.2025 03.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 4
  • Medium 3

Disclosures per year

  1. 2025: 4
  2. 2026: 4
  1. Critical · 10.0 CVE-2026-32871 < 3.2.0 3.2.0
  2. Medium · 6.7 CVE-2025-64340 < 3.2.0 3.2.0
  3. FastMCP OAuth Proxy token reuse across MCP servers this entry
    High CVE-2025-69196 < 2.14.2 2.14.2
  4. High ghsa-rcfx-77hg-w2wv < 2.14.0 2.14.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.