## Summary
CVE-2026-59971 affects designcomputer/mysql_mcp_server when run in SSE/HTTP mode (MCP_TRANSPORT=sse) prior to 0.4.2. In this mode, the server exposes unauthenticated routes and disables DNS-rebinding/origin/host protections, enabling a network attacker to execute arbitrary SQL and potentially read/write server files (and possibly achieve RCE) if the configured MySQL user has FILE privileges.
## Technical Details
- Root cause in src/mysql_mcp_server/server.py: SseServerTransport is constructed without passing security_settings, disabling the MCP Python SDK DNS-rebinding protection (Origin/Host header validation).
- Authorization/auth controls: Starlette routes /, /sse, /messages/ have no authentication and there is no CORS/TrustedHost middleware.
- Exposure: service binds to 0.0.0.0 by default in SSE mode.
- Injection sink: attacker-controlled SQL reaches cursor.execute(query).
- Attack scenarios:
- Direct exposure: attacker invokes execute_sql without credentials to run arbitrary SQL.
- DNS rebinding: attacker uses a victim browser as a same-origin relay by rebinding to 127.0.0.1/internal IP, then POSTs to invoke execute_sql.
## Affected
- designcomputer/mysql_mcp_server versions: ≤ 0.4.1 (fixed in 0.4.2).
- Trigger condition: MCP_TRANSPORT=sse (default stdio transport is not affected).
- Component: _run_sse_server() in src/mysql_mcp_server/server.py.
## Impact
- Unauthenticated arbitrary SQL execution against the configured MySQL database.
- Full data exfiltration and modification.
- If the MySQL account has FILE privileges: arbitrary file read/write via LOAD_FILE and INTO OUTFILE, potentially enabling RCE (e.g., webshell drop).
## Mitigation
1. Upgrade to 0.4.2 or later (patch immediately).
2. Ensure SSE is not exposed publicly; the advisory recommends binding to 127.0.0.1.
3. If operating SSE, set/verify DNS-rebinding protections are enabled (the fix passes TransportSecuritySettings(enable_dns_rebinding_protection=True, allowed_hosts=...) to SseServerTransport).
4. Restrict network access to the SSE service and avoid deployments with 0.0.0.0 binding and no authentication.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CWE-306