ProxySQL — это прокси-сервер для MySQL и его ответвлений, а также PostgreSQL. В версиях с 3.0.0 по 3.0.8 инструмент ProxySQL GenAI/MCP `run_sql_readonly` нарушает свой документированный контракт только для чтения для целей MySQL. 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`.
В результате вызывающая сторона может отправить первый оператор, доступный только для чтения, за которым следует второй оператор с побочным эффектом, например `SELECT 1; ПЕРЕИМЕНОВАТЬ ТАБЛИЦУ...`. 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. В реальном тесте среды выполнения MCP конечная точка `/mcp/query` приняла запрос `run_sql_readonly`.
В ответе MCP сообщалось об успехе первого запроса SELECT, а прямая внутренняя проверка показала, что таблица действительно была переименована. 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. Версия 3.0.9 содержит исправление.
Другие меры, принимаемые оператором, включают в себя: сохранение MCP отключенным, если это не требуется; установка непустого токена `mcp-query_endpoint_auth` перед раскрытием `/mcp/query`; ограничение воздействия сети прослушивателя MCP; настройка целевых учетных данных серверной части MCP в качестве пользователей с правами только для чтения на уровне базы данных; и добавление временных правил запросов MCP для блокировки очевидных шаблонов с несколькими операторами.
Показать оригинальное описание (EN)
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.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 1
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Proxysql Proxysql
cpe:2.3:a:proxysql:proxysql:*:*:*:*:*:*:*:*
|
4.0.6
|
4.0.9
|