Vulnerabilities in pkg:pypi/mysql-mcp-server

PACKAGE
Advisory Identifier: GHSA-rqfv-2mw9-78g2
Advisory Summary

CVE-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.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/mysql-mcp-server

2 Known Advisory Record(s)

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

CVE Identifier CVE-2026-59971
GHSA Identifier GHSA-rqfv-2mw9-78g2
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-306: Missing Authentication for Critical Function
Affected Product MySQL MCP Server
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

mysql-mcp-server fixed: 0.4.2
pip install mysql-mcp-server>=0.4.2
Verify Direct and Transitive Dependencies

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

## Summary In 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. **Trigger condition:** `MCP_TRANSPORT=sse`. The default stdio mode is not affected. ## Attack Scenarios **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. **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. ## Root Cause In `src/mysql_mcp_server/server.py`: 1. `SseServerTransport` is constructed without `security_settings` — the SDK defaults `enable_dns_rebinding_protection` to `False`. 2. The Starlette app has no CORS or TrustedHost middleware. 3. All three routes (`/`, `/sse`, `/messages/`) are unauthenticated. 4. The service binds to `0.0.0.0` by default. 5. The sink is `cursor.execute(query)` with a fully attacker-controlled query. ## Impact - Unauthenticated arbitrary SQL execution against the configured database - Full data exfiltration and modification - If the MySQL account holds `FILE` privilege: arbitrary file read (`LOAD_FILE`) and write (`INTO OUTFILE`) — potential RCE via webshell drop - Internet-wide scanning has identified 25 publicly reachable SSE instances of this project ## Fix Released 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`. ## Credits Discovered by Huanchen, SongWu (JHU), and BrookeYangRui (JHU).

CVE-2026-59971 Affected MySQL MCP Server Versions

1 component(s)
Fixed Versions:
0.4.2
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?
CVE-2026-59971 is a security vulnerability in MySQL MCP Server involving Missing Origin/Host Validation in SSE Transport Enables Unauthenticated SQL Execution (DNS Rebinding / Direct Exposure) under CWE-306: Missing Authentication for Critical Function.
Which MySQL MCP Server versions are affected?
Affected versions include releases prior to 0.4.2 across affected packages: mysql-mcp-server.
What version fixes CVE-2026-59971?
Upgrading to 0.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mysql-mcp-server affected?
Yes, mysql-mcp-server is affected in releases prior to 0.4.2. Upgrade your dependency to 0.4.2 or later.
What is the CVSS score of CVE-2026-59971?
CVE-2026-59971 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-59971?
CVE-2026-59971 is classified under CWE-306: Missing Authentication for Critical Function (The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.).
How can I check PyPI dependencies for CVE-2026-59971?
Run the dependency tree command: 'pip show mysql-mcp-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}