Media

FastMCP vulnerable to reflected XSS in client's callback page

  • Publicada: 29.10.2025
  • Actualizado: 11.10.2026 13:18

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

  1. 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())
  1. Ensure that the MCP server located at http://127.0.0.1:8000/mcp supports oauth.
  2. Start the client.
  3. As soon as the callback server has been started, access http://localhost:1337/callback?error=<img/src/onerror=alert(window.origin)>

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.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) fastmcp < 2.13.0 2.13.0

Referencias

Puntuación CVSS -
Vector CVSS
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Debilidad (CWE)
CWE-79
Plataforma
Python (PyPI)
Paquete
fastmcp
Publicada
29.10.2025
Actualizado
11.10.2026 13:18

Fuentes y licencias

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

OSV / GitHub Advisory Database - GHSA-mxxr-jv3v-6pgc - CC BY 4.0

Historial de vulnerabilidades: fastmcp

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
8
Primera → última
10.2025 03.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 4
  • Media 3

Divulgaciones por año

  1. 2025: 4
  2. 2026: 4
  1. Crítica · 10.0 CVE-2026-32871 < 3.2.0 3.2.0
  2. Media · 6.7 CVE-2025-64340 < 3.2.0 3.2.0
  3. Alta CVE-2025-69196 < 2.14.2 2.14.2
  4. Alta ghsa-rcfx-77hg-w2wv < 2.14.0 2.14.0
  5. FastMCP vulnerable to reflected XSS in client's callback page esta entrada
    Media CVE-2025-62800 < 2.13.0 2.13.0

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.