/

CVE-2026-59971

Severity:

CRITICAL RISK

(10.0)

Unauthenticated SQL Access (CWE-306) in MySQL MCP Server

CVE-2026-59971

Awaiting Analysis

Vulnerability type

Category:

Missing Authentication

CWE:

CWE-306, CWE-346

Impact:

Unauthenticated database access and potential server compromise

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

MySQL MCP Server can expose its Server-Sent Events transport without authentication or DNS-rebinding protection when SSE mode is enabled. A network attacker, or a victim's browser acting as a relay, may submit SQL queries that disclose or modify the configured database; accounts with FILE privileges may also expose server files or support further code execution.

Affected context

The risk occurs in deployments that enable the SSE transport and expose the Starlette endpoints without authentication. It is more significant when the service binds to all network interfaces, when browser-based access is possible, or when the configured MySQL account has broad privileges such as FILE. The default stdio transport is not affected by this exposure pattern.

Exploit preconditions

  • Attack surface: HTTP-based SSE and message routes exposed by the MCP server
  • Required access: Network reachability, or access to a browser that can reach the service through DNS rebinding
  • Trigger point: An unauthenticated request that reaches the SQL execution tool
  • Why exploitation is possible: The transport lacks effective authentication and origin protections, allowing attacker-controlled queries to reach database execution
  • Privilege dependency: The resulting impact depends on the permissions of the configured MySQL account

Why this happens

The underlying issue is missing access control around an exposed MCP transport, mapping primarily to CWE-306: Missing Authentication for Critical Function. The SSE server is created without security settings, while its routes accept requests without establishing the caller's identity or authorization. The absence of DNS-rebinding protection also relates to CWE-346: Origin Validation Error, because browser-origin assumptions are not sufficiently enforced before sensitive requests are processed. Binding the service broadly increases the reachable attack surface.

Potential impact

  • An unauthenticated attacker may read sensitive database contents
  • An attacker could modify, delete, or corrupt application data
  • Queries may expose credentials, tokens, or other stored secrets
  • A MySQL account with FILE privileges could read or write server-side files
  • File access could enable further compromise or code execution depending on deployment permissions
  • The database or connected application may be used for lateral movement or data poisoning

General mitigation guidance

Mitigation generally focuses on ensuring that network-accessible MCP transports are authenticated, authorized, and protected against browser-origin abuse.

Common defensive patterns include:

  • Require strong authentication and per-operation authorization for SSE and message endpoints
  • Enable DNS-rebinding and origin validation protections for browser-reachable services
  • Bind services to the loopback interface or a restricted network interface unless broader exposure is required
  • Prefer stdio transport where remote HTTP access is not needed
  • Apply least privilege to the MySQL account and avoid granting FILE or other unnecessary administrative privileges
  • Place the service behind an authenticated gateway with restrictive network policy and TLS
  • Treat SQL supplied through tools as untrusted input and enforce narrowly scoped database operations

How teams detect issues like this

Organizations can identify this exposure through:

  • Configuration checks for SSE transport combined with broad interface binding
  • Static and dependency-aware analysis for transport construction without authentication or origin protections
  • Code review checks confirming that every sensitive route performs authentication and authorization
  • Network scans that inventory externally reachable MCP HTTP endpoints
  • Policy enforcement preventing unauthenticated database tools from being exposed outside approved boundaries
  • Database audit logs identifying unexpected queries, unusual clients, or access to file-related functionality

Automated security review tools may help flag missing route guards and insecure transport configuration.

Sources

SourceLink
github.comgithub.com/designcomputer/mysql_mcp_server/commit/a96549f4a4d65443fd6e9c7f2324fba9a5c80a82
github.comgithub.com/designcomputer/mysql_mcp_server/issues/92
github.comgithub.com/designcomputer/mysql_mcp_server/releases/tag/v0.4.2
github.comgithub.com/designcomputer/mysql_mcp_server/security/advisories/GHSA-rqfv-2mw9-78g2

Frequently asked

questions

Yes, when the SSE service is network-reachable without effective authentication. A DNS-rebinding scenario may also cause a victim's browser to relay requests to a locally reachable service.

Direct exploitation generally requires network access to the exposed HTTP endpoints. Browser-mediated exploitation may require only that a victim visit attacker-controlled content while the service is reachable from the victim's browser.

Use an authenticated and authorized transport, enforce origin and DNS-rebinding protections, restrict network exposure, and run database operations with a least-privilege account.

Make secure transport settings the default, require explicit authorization for database tools, inventory exposed MCP endpoints, and continuously enforce network, identity, and database privilege policies.

Find out what's already
exploitable in your codebase.