MySQL MCP Server SSE Transport Missing Origin/Host Validation - Unauthenticated SQL Execution (CVE-2026-59971)
Detects exploitation of CVE-2026-59971, a CVSS 10.0 flaw in the mysql-mcp-server (pip) package versions < 0.4.2. The SSE (Server-Sent Events) HTTP transport fails to validate the Origin and Host headers (CWE-306 Missing Authentication, CWE-346 Origin Validation Error), allowing an attacker to reach the MCP JSON-RPC endpoint and invoke database tools without authentication. This enables unauthenticated SQL execution either via direct network exposure of the SSE listener or via DNS rebinding attacks against a locally-bound server from a victim's browser. Detection focuses on requests to MCP SSE/message endpoints (commonly /sse and /messages) carrying missing, external, or mismatched Origin/Host headers, followed by MCP tool-invocation JSON-RPC calls (tools/call with execute_sql) and subsequent anomalous MySQL query activity.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- pip
- Product
- mysql-mcp-server
- Versions
- < 0.4.2
Timeline
- Disclosed
- September 11, 2026
References & Proof of Concept
CVSS
What is CVE-2026-59971 MySQL MCP Server SSE Transport Missing Origin/Host Validation - Unauthenticated SQL Execution (CVE-2026-59971)?
MySQL MCP Server SSE Transport Missing Origin/Host Validation - Unauthenticated SQL Execution (CVE-2026-59971) (CVE-2026-59971) maps to the Initial Access and Collection and Exfiltration tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for MySQL MCP Server SSE Transport Missing Origin/Host Validation - Unauthenticated SQL Execution (CVE-2026-59971), covering the data sources and telemetry it touches: Network Proxy / WAF logs, Reverse proxy (nginx) access logs. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Initial Access Collection Exfiltration
let mcpPaths = dynamic(["/sse", "/messages", "/message", "/mcp"]);
let privateHosts = dynamic(["localhost", "127.0.0.1", "::1"]);
CommonSecurityLog
| where DeviceVendor has_any ("Zscaler", "Palo Alto", "nginx", "F5") or isnotempty(RequestURL)
| extend Path = tostring(parse_url(RequestURL).Path)
| where Path has_any (mcpPaths)
| extend OriginHdr = tostring(AdditionalExtensions)
| where RequestMethod in ("POST", "GET")
| where (isnotempty(RequestClientApplication) and RequestClientApplication !has "mcp")
or SourceIP !startswith "127."
| project TimeGenerated, SourceIP, DestinationIP, DestinationPort, RequestURL, Path, RequestMethod, RequestClientApplication, OriginHdr
| order by TimeGenerated desc Flags HTTP requests to MySQL MCP Server SSE transport endpoints (/sse, /messages) that originate from non-loopback sources, indicating direct network exposure or proxied external access to an endpoint that should be local-only.
Data Sources
Required Tables
False Positives
- Legitimate MCP clients (IDE integrations, LLM orchestrators) on the same host using a loopback address that appears as an internal proxied IP.
- Security scanners and vulnerability assessment tools probing the endpoint during authorized testing.
- Container/sidecar networking where the MCP server is intentionally reached over a private overlay network by a trusted agent.
Sigma rule & cross-platform mapping
The detection logic for MySQL MCP Server SSE Transport Missing Origin/Host Validation - Unauthenticated SQL Execution (CVE-2026-59971) (CVE-2026-59971) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: network_connection
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-59971
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Direct unauthenticated SSE connection with missing Origin
Expected signal: Proxy/web log entry for GET /sse from a non-loopback source with no Origin header.
- Test 2JSON-RPC execute_sql tool call over message endpoint
Expected signal: POST /messages event with a tools/call execute_sql body and a corresponding MySQL query-log entry for SELECT current_user().
- Test 3DNS rebinding against loopback-bound server via spoofed Host header
Expected signal: Local HTTP request to /messages bearing an external Host and Origin header that the vulnerable server accepts.
Response Playbook
Triage
- Confirm whether the destination host runs mysql-mcp-server and determine its version; any version < 0.4.2 is vulnerable. Check the installed package with `pip show mysql-mcp-server`.
- Determine the transport binding: inspect how the server was launched and whether the SSE listener is bound to 0.0.0.0 (network-exposed) or 127.0.0.1 (DNS-rebinding risk only). Exposure on a non-loopback interface is the highest-severity condition.
- Review the Origin and Host headers on the flagged requests. A missing Origin, an external Origin, or a Host that does not match the expected loopback indicates exploitation rather than a legitimate local client.
- Correlate the SSE connection with subsequent JSON-RPC `tools/call` payloads invoking `execute_sql` and cross-reference against MySQL general/audit logs for queries executed in the same window.
Containment
- Immediately restrict the SSE listener: rebind to 127.0.0.1 only, place it behind an authenticating reverse proxy, or firewall the listening port (commonly 5000/8000) to trusted hosts.
- Upgrade mysql-mcp-server to >= 0.4.2, which adds Origin/Host validation, and restart the service.
- Rotate the MySQL credentials configured for the MCP server and review/limit the database account's privileges to least necessary.
- If active exploitation is confirmed, isolate the host from the network pending investigation.
Evidence Collection
- Capture reverse-proxy / web server access logs showing request paths, Origin/Host headers, source IPs, and timestamps for the flagged sessions.
- Export MySQL general query log or audit log entries for the relevant time window to establish which SQL statements were executed via the MCP server.
- Preserve the mysql-mcp-server process command line, configuration, and the installed package version for forensic record.
Escalation Criteria
- ! Escalate to incident response if JSON-RPC execute_sql calls from a non-loopback or missing-Origin source are confirmed against production data.
- ! Escalate if the SSE listener was bound to a non-loopback interface and reachable from untrusted networks, regardless of confirmed data access.
- ! Escalate if SQL activity indicates data exfiltration (large SELECTs, dumps) or tampering (DROP/UPDATE/DELETE) correlated with the suspicious MCP sessions.
Investigation Guide
Forensic Artifacts
- >
Reverse-proxy/web access logs with Origin/Host headers for /sse and /messages requests - >
MySQL general query log / audit log entries correlated to MCP tool invocations - >
mysql-mcp-server process command line and configuration showing the bind address - >
Installed pip package version metadata (mysql-mcp-server < 0.4.2)
Tuning Guidance
Baseline the legitimate MCP client source IPs and Origin values in your environment (typically loopback or a known IDE/agent host) and allowlist them. If the server is correctly bound to 127.0.0.1 and fronted by an authenticating proxy, narrow the rule to requests whose Origin/Host fail validation rather than all non-loopback sources. Tune the correlation window in the EQL/sequence rules to match observed SSE-to-tool-call latency, and exclude known scanner and monitoring user-agents to reduce noise.
Hunting Queries
Hunts for non-loopback sources reaching MCP SSE endpoints, surfacing candidate exposed or rebound mysql-mcp-server instances for triage.
CommonSecurityLog | where RequestURL has_any ("/sse", "/messages") | extend Origin = tostring(parse_json(AdditionalExtensions).requestClientApplication) | where SourceIP !startswith "127." | summarize count() by SourceIP, RequestURL, bin(TimeGenerated, 1h) index=proxy (uri_path="/sse" OR uri_path="/messages") NOT src_ip=127.0.0.1 | stats count values(uri_path) by src_ip http_origin Atomic Red Team Tests
Opens an SSE session against a network-exposed mysql-mcp-server without supplying an Origin header, simulating direct exposure exploitation.
Command
curl -sN -X GET http://TARGET_HOST:5000/sse -H 'Accept: text/event-stream' Cleanup
No artifacts created; terminate the curl process (Ctrl-C) to close the stream. Expected Telemetry
Proxy/web log entry for GET /sse from a non-loopback source with no Origin header.
Expected Detection
KQL/SPL rules flag the non-loopback request to /sse with missing Origin.
Posts an MCP JSON-RPC tools/call invoking execute_sql to the /messages endpoint without authentication or valid Origin, simulating SQL execution.
Command
curl -s -X POST http://TARGET_HOST:5000/messages -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"execute_sql","arguments":{"query":"SELECT current_user();"}}}' Cleanup
The SELECT is read-only; no cleanup required. If a write query was used in testing, manually revert the affected rows. Expected Telemetry
POST /messages event with a tools/call execute_sql body and a corresponding MySQL query-log entry for SELECT current_user().
Expected Detection
Elastic EQL sequence correlates the SSE open with the execute_sql tools/call; MySQL query log shows the executed statement.
Simulates a DNS-rebinding request reaching a loopback-bound MCP server by sending a spoofed external Host/Origin header, which the vulnerable version fails to validate.
Command
curl -s -X POST http://127.0.0.1:5000/messages -H 'Host: attacker.example.com' -H 'Origin: http://attacker.example.com' -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"execute_sql","arguments":{"query":"SHOW DATABASES;"}}}' Cleanup
Read-only query; no cleanup required. Expected Telemetry
Local HTTP request to /messages bearing an external Host and Origin header that the vulnerable server accepts.
Expected Detection
Rules flag the mismatched Host/Origin header on the MCP endpoint; patched (>=0.4.2) servers reject the request with an origin-validation error.