PyPI: fastmcp

CVE-2025-62800

Safety vulnerability ID: SFTY-20251029-10561

Safety legacy ID: pyup.io-80983

Affected versions of the fastmcp package are vulnerable to Cross-site Scripting (XSS) due to unsanitized user-controlled content being embedded in the OAuth client’s callback HTML. The create_callback_html function in src/fastmcp/client/oauth_callback.py inserts the message parameter—including values propagated from query parameters such as error—directly into the page without HTML escaping, enabling reflected XSS.

Created at: Nov 7, 2025Updated at: Nov 7, 2025

Overview

FastMCP vulnerable to reflected XSS in client's callback page

Advisory

Affected versions of the fastmcp package are vulnerable to Cross-site Scripting (XSS) due to unsanitized user-controlled content being embedded in the OAuth client’s callback HTML. The create_callback_html function in src/fastmcp/client/oauth_callback.py inserts the message parameter—including values propagated from query parameters such as error—directly into the page without HTML escaping, enabling reflected XSS.

Affected Package

Affecting fastmcp package, versions
<2.13.0

Also affects

---

How to Fix

Upgrade
fastmcp
to
2.13.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more