Vulnerabilities in pkg:pypi/mysql-mcp-server
PACKAGECVE-2026-59971 is a CRITICAL (CVSS 10.0) missing origin/host validation vulnerability (CWE-306: Missing Authentication for Critical Function) affecting MySQL MCP Server libraries in the PyPI ecosystem. The issue involves missing origin/host validation in sse transport enables unauthenticated sql execution (dns rebinding / direct exposure). Remediation is available by upgrading affected packages to version 0.4.2.
pkg:pypi/mysql-mcp-server
Vulnerability advisories affecting package pkg:pypi/mysql-mcp-server. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-rqfv-2mw9-78g2 | CVE-2026-59971 | CRITICAL | MySQL MCP Server: Missing Origin/Host Validation in SSE Transport Enables Unauthenticated SQL Execution (DNS Rebinding / Direct Exposure) |
| GHSA-mvq4-39wx-6h5g | CVE-2026-11529 | LOW | MySQL MCP Server is Vulnerable to SQL Injection Through its mysql URI Handler |
CVE-2026-59971 at a Glance
Security Impact
CVSS: 10.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-59971
To remediate this vulnerability, upgrade all affected MySQL MCP Server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install mysql-mcp-server>=0.4.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mysql-mcp-server
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-59971, inspect your installed packages using pip:
pip show mysql-mcp-server
Analyze the terminal output to locate any version of MySQL MCP Server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.2), your application is affected.
Note: The pip show mysql-mcp-server command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. In MySQL MCP Server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-59971 Affected MySQL MCP Server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mysql-mcp-server
|
PyPI |
< 0.4.2
|
0.4.2
|
References
Frequently Asked Questions
What is CVE-2026-59971?
Which MySQL MCP Server versions are affected?
What version fixes CVE-2026-59971?
Is mysql-mcp-server affected?
What is the CVSS score of CVE-2026-59971?
What CWE is associated with CVE-2026-59971?
How can I check PyPI dependencies for CVE-2026-59971?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rqfv-2mw9-78g2",
"modified" : "2026-09-11T20:35:42Z",
"published" : "2026-09-11T20:35:42Z",
"aliases" : [ "CVE-2026-59971" ],
"summary" : "MySQL MCP Server: Missing Origin/Host Validation in SSE Transport Enables Unauthenticated SQL Execution (DNS Rebinding / Direct Exposure)",
"details" : "## Summary\n\nIn SSE/HTTP transport mode, `mysql_mcp_server` constructs `SseServerTransport` without passing `security_settings`. 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.\n\n**Trigger condition:** `MCP_TRANSPORT=sse`. The default stdio mode is not affected.\n\n## Attack Scenarios\n\n**Scenario A — Direct exposure:** Any network attacker can invoke `execute_sql` to run arbitrary SQL without credentials → full data dump, and via MySQL `FILE` privileges, arbitrary file read/write and RCE.\n\n**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 `execute_sql` as same-origin.\n\n## Root Cause\n\nIn `src/mysql_mcp_server/server.py`:\n\n1. `SseServerTransport` is constructed without `security_settings` — the SDK defaults `enable_dns_rebinding_protection` to `False`.\n2. The Starlette app has no CORS or TrustedHost middleware.\n3. All three routes (`/`, `/sse`, `/messages/`) are unauthenticated.\n4. The service binds to `0.0.0.0` by default.\n5. The sink is `cursor.execute(query)` with a fully attacker-controlled query.\n\n## Impact\n\n- Unauthenticated arbitrary SQL execution against the configured database\n- Full data exfiltration and modification\n- If the MySQL account holds `FILE` privilege: arbitrary file read (`LOAD_FILE`) and write (`INTO OUTFILE`) — potential RCE via webshell drop\n- Internet-wide scanning has identified 25 publicly reachable SSE instances of this project\n\n## Fix\n\nReleased in v0.4.2: DNS-rebinding protection is now enabled by passing `TransportSecuritySettings(enable_dns_rebinding_protection=True)` to `SseServerTransport`, and the documented recommended bind address is `127.0.0.1`.\n\n## Credits\n\nDiscovered by Huanchen, SongWu (JHU), and BrookeYangRui (JHU).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mysql-mcp-server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/designcomputer/mysql_mcp_server/security/advisories/GHSA-rqfv-2mw9-78g2"
}, {
"type" : "WEB",
"url" : "https://github.com/designcomputer/mysql_mcp_server/issues/92"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/designcomputer/mysql_mcp_server"
}, {
"type" : "WEB",
"url" : "https://github.com/designcomputer/mysql_mcp_server/releases/tag/v0.4.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-306", "CWE-346" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-11T20:35:42Z",
"nvd_published_at" : null
}
}