p PatchFirst

CVE-2026-59971

CVE-2026-59971 · MySQL MCP Server: Missing Origin/Host Validation in SSE Transport Enables Unauthenticated SQL Execution (DNS Rebinding / Direct Exposure)

This page contains facts from public vulnerability sources. Check the original advisory before updating.

MySQL MCP Server is a Model Context Protocol server that enables secure interaction with MySQL databases. Prior to 0.4.2, setting MCP_TRANSPORT=sse causes src/mysql_mcp_server/server.py to construct SseServerTransport without security_settings or enable_dns_rebinding_protection, while the Starlette routes /, /sse, and /messages/ have no authentication and the service binds to 0.0.0.0 by default. A network attacker can directly reach execute_sql, or can use DNS rebinding to make a victim's browser relay same-origin requests to a locally bound service, and supply a query that reaches cursor.execute(query). This allows unauthenticated disclosure and modification of the configured database; when the MySQL account has FILE privileges, the same access can read or write server files and may enable code execution. The default stdio transport is not affected. This issue is fixed in 0.4.2.

CVSS 10.0 · Critical · EPSS 0.4% · Fix available

Published
Updated

Stack: python

Affected products and versions

  • mysql_mcp_server

    Versions
    • < 0.4.2: Affected

    No fix published

  • mysql-mcp-server PyPI

    Versions
    • 0.1.0
    • 0.1.2
    • 0.2.0
    • 0.2.1
    • 0.2.2
    • 0.3.0
    • 0.3.1
    • 0.4.0
    • 0.4.1
    Affected ranges
    • ECOSYSTEM: < 0.4.2

    Update to 0.4.2

Original sources

Check your server →