MySQL MCP Server: Missing Origin/Host Validation in SSE Transport Enables Unauthenticated SQL Execution (DNS Rebinding / Direct Exposure)
CVE-2026-59971 · GHSA-rqfv-2mw9-78g2
- Affected
- PyPI mysql-mcp-server < 0.4.2
- Fixed in
- 0.4.2· Vendor fix available
- Issue
- In SSE/HTTP transport mode, mysqlmcpserver constructs SseServerTransport without passing securitysettings. As a result, the MCP Python SDK's DNS-rebinding protection (Origin/Host header validation) is disabled; the Starlette application has no CORS or TrustedHost middleware; and the service binds to 0.0.0.0 by default with no authentication on any route. Trigger condition: MCPTRANSPORT=sse. The default stdio mode is not affected. Attack Scenarios Scenario A — Direct exposure: Any network attacker can invoke executesql to run arbitrary SQL without credentials → full data dump, and via MySQL FILE privileges, arbitrary file read/write and RCE. Scenario B — DNS rebinding (local bind): An attacker lures a victim's browser to a malicious page, rebinds their domain to 127.0.0.1, and uses the browser as a proxy to invoke executesql as same-origin. Root Cause In src/mysqlmcpserver/server.py: 1. SseServerTransport is constructed without securitysettings — the SDK defaults…
Recommended action: Upgrade to 0.4.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.