CVE-2025-62800: FastMCP vulnerable to reflected XSS in client's callback page
Summary While setting up an oauth client, it was noticed that the callback page hosted by the client during the flow embeds user-controlled content without escaping or sanitizing it. This leads to a reflected Cross-Site-Scripting vulnerability.
Published Oct 29, 2025
Affected packages
fastmcp
- Ecosystem
- PyPI
- Affected
- < 2.13.0
- Fixed in
- 2.13.0
- Check
pip show fastmcp
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
While setting up an oauth client, it was noticed that the callback page hosted by the client during the flow embeds user-controlled content without escaping or sanitizing it. This leads to a reflected Cross-Site-Scripting vulnerability.
Details
The affected code is located in *https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/oauth_callback.py*, which embeds all values passed to the create_callback_html function via the message parameter it into the callback page without escaping them. This can, for example, be abused by calling the callback server with an XSS payload inside the error GET parameter, the value of which will then be inserted into the callback page, causing the execution of attacker-controlled JavaScript code in the callback server's origin. Note that besides the error parameter, other parameters reaching this function are affected too.
PoC
- Setup a simple fastmcp client such as this one (the callback server's port was fixated for simplicity):
url="http://127.0.0.1:8000/mcp"
oauth = OAuth(mcp_url=url,callback_port=1337)
async def main():
async with Client(url, auth=oauth) as client:
await client.ping()
# List available operations
tools = await client.list_tools()
print(f"tools: {tools}")
asyncio.run(main())- Ensure that the MCP server located at
http://127.0.0.1:8000/mcpsupports oauth. - Start the client.
- As soon as the callback server has been started, access
http://localhost:1337/callback?error=
Note that the exploitation could also for example be initiated by a malicious authorization server by returning the exploitation URL mentioned before in the authorization_endpoint field. The client would then automatically open, causing the XSS to trigger immediatly.
Impact
The impact of this XSS vulnerability is the arbitrary JavaScript execution in the victim's browser in the callback server's origin.
Credited to an7y.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More FastMCP vulnerabilities
All FastMCP entriesCVE-2025-64340
FastMCP has a Command Injection vulnerability - Gemini CLI
medium6.7Mar 31, 2026CVE-2026-27124
FastMCP: Missing Consent Verification in OAuth Proxy Callback Facilitates Confused Deputy Vulnerabilities
high8.2Mar 31, 2026CVE-2026-32871
FastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerability
critical10.0Mar 31, 2026CVE-2025-69196
FastMCP OAuth Proxy token reuse across MCP servers
high7.4Mar 16, 2026GHSA-rcfx-77hg-w2wv
FastMCP updated to MCP 1.23+ due to CVE-2025-66416
highDec 26, 2025CVE-2025-62801
FastMCP vulnerable to windows command injection in FastMCP Cursor installer via server_name
medium5.4Oct 29, 2025
