CVE-2026-48774
JSON

7.5high

ProxySQL MCP run_sql_readonly executes side-effecting MySQL multi-statements despite read-only contract

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.39% (higher than 25% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
BIT-PROXYSQL-2026-48774GHSA-7wh6-2vcc-gcm4

Description

ProxySQL is a proxy for MySQL and its forks, as well as PostgreSQL. In versions 3.0.0 through 3.0.8, ProxySQL's GenAI/MCP `run_sql_readonly` tool violates its documented read-only contract for MySQL targets. The tool validates only the full input string with a substring blacklist and first-keyword allowlist, but then executes the entire SQL string on a backend connection created with `CLIENT_MULTI_STATEMENTS`. As a result, a caller can submit a read-only first statement followed by a side-effecting second statement, such as `SELECT 1; RENAME TABLE ...`. The validator accepts the payload because it starts with `SELECT` and because side-effecting MySQL statements such as `RENAME TABLE`, `SET`, `RESET`, `LOCK TABLES`, and `KILL` are not rejected by the blacklist. In a live MCP runtime test, the `/mcp/query` endpoint accepted a `run_sql_readonly` request. The MCP response reported success for the first `SELECT`, and direct backend verification showed that the table had actually been renamed. This violates the endpoint's read-only security contract and lets an MCP caller perform backend writes or administrative SQL, limited by the configured MCP target account's database privileges. Version 3.0.9 contains a fix. Other operator mitigations include: keeping MCP disabled unless required; setting a non-empty `mcp-query_endpoint_auth` token before exposing `/mcp/query`; restricting MCP listener network exposure; configuring MCP backend target credentials as database-level read-only users; and adding temporary MCP query rules to block obvious multi-statement patterns.

Affected

Product or packageVersionsReported by
sysown proxysql>= 3.0.6, < 3.0.9CVE List
proxysql proxysqlfrom 4.0.6 before 4.0.9NVD
proxysql (Bitnami)from 3.0.6 before 3.0.9Bitnami Vulnerability Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Bitnami Vulnerability Databasehigh rating

Classification

CWE-20

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

ProxySQL is a proxy for MySQL and its forks, as well as PostgreSQL. In versions 3.0.0 through 3.0.8, ProxySQL's GenAI/MCP `run_sql_readonly` tool violates its documented read-only contract for MySQL targets. The tool validates only the full input string with a substring blacklist and first-keyword allowlist, but then executes the entire SQL string on a backend connection created with `CLIENT_MULTI_STATEMENTS`. As a result, a caller can submit a read-only first statement followed by a side-effecting second statement, such as `SELECT 1; RENAME TABLE ...`. The validator accepts the payload because it starts with `SELECT` and because side-effecting MySQL statements such as `RENAME TABLE`, `SET`, `RESET`, `LOCK TABLES`, and `KILL` are not rejected by the blacklist. In a live MCP runtime test, the `/mcp/query` endpoint accepted a `run_sql_readonly` request. The MCP response reported success for the first `SELECT`, and direct backend verification showed that the table had actually been renamed. This violates the endpoint's read-only security contract and lets an MCP caller perform backend writes or administrative SQL, limited by the configured MCP target account's database privileges. Version 3.0.9 contains a fix. Other operator mitigations include: keeping MCP disabled unless required; setting a non-empty `mcp-query_endpoint_auth` token before exposing `/mcp/query`; restricting MCP listener network exposure; configuring MCP backend target credentials as database-level read-only users; and adding temporary MCP query rules to block obvious multi-statement patterns.

NVD (es)

ProxySQL es un proxy para MySQL y sus bifurcaciones, así como PostgreSQL. En las versiones 3.0.0 a 3.0.8, la herramienta “run_sql_readonly” de GenAI/MCP de ProxySQL viola su contrato de solo lectura documentado para objetivos de MySQL. La herramienta valida solo la cadena de entrada completa con una lista negra de subcadenas y una lista blanca de la primera palabra clave, pero luego ejecuta la cadena SQL completa en una conexión de backend creada con “CLIENT_MULTI_STATEMENTS”. Como resultado, un llamador puede enviar una primera declaración de solo lectura seguida de una segunda declaración con efectos secundarios, como “SELECT 1; RENAME TABLE ...”. El validador acepta la carga útil porque comienza con “SELECT” y porque las declaraciones de MySQL con efectos secundarios como “RENAME TABLE”, “SET”, “RESET”, “LOCK TABLES” y “KILL” no son rechazadas por la lista negra. En una prueba de tiempo de ejecución de MCP en vivo, el endpoint “/mcp/query” aceptó una solicitud “run_sql_readonly”. La respuesta de MCP informó éxito para el primer “SELECT”, y la verificación directa del backend mostró que la tabla había sido realmente renombrada. Esto viola el contrato de seguridad de solo lectura del endpoint y permite a un llamador de MCP realizar escrituras en el backend o SQL administrativo, limitado por los privilegios de base de datos de la cuenta objetivo de MCP configurada. La versión 3.0.9 contiene una corrección. Otras mitigaciones del operador incluyen: mantener MCP deshabilitado a menos que sea necesario; establecer un token “mcp-query_endpoint_auth” no vacío antes de exponer “/mcp/query”; restringir la exposición de red del oyente de MCP; configurar las credenciales del objetivo de backend de MCP como usuarios de solo lectura a nivel de base de datos; y añadir reglas de consulta de MCP temporales para bloquear patrones obvios de múltiples declaraciones.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-48774 changed 2026-06-23CVE Terms of Use
NVDCVE-2026-48774 changed 2026-10-25Public domain
Bitnami Vulnerability DatabaseBIT-PROXYSQL-2026-48774 changed 2026-09-08Apache-2.0