CVE-2026-62153: mysql_fdw SQL injection through ANALYZE, IMPORT FOREIGN SCHEMA and the sql_mode option
mysqlfdw inserts several values into statements sent to the remote MySQL server without escaping them: the dbname and tablename options in ANALYZE, the remote schema name and the LIMIT TO and EXCEPT table names in IMPORT FOREIGN SCHEMA, and the sqlmode option in the SET sqlmode command. A user who can create or alter foreign tables or foreign servers, or run IMPORT FOREIGN SCHEMA, can break out of the string literal and run arbitrary SQL on the remote MySQL server with the credentials of the user mapping. The issue is fixed in mysqlfdw 2.10.0. From mysqlfdw 2.10.0, mysqlfdw escapes these names and accepts only letters, digits, underscores and commas in sqlmode.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mysql_fdwto a version that resolves this vulnerability.Fixed in 2.10.0
Event History
Frequently Asked Questions
Which users can exploit this issue?
A user must be able to create or alter foreign tables or foreign servers, or be able to run IMPORT FOREIGN SCHEMA. Exploitation runs SQL on the remote MySQL server using the credentials configured in the applicable user mapping.
Which inputs are vulnerable?
Affected inputs are the dbname and table_name options used by ANALYZE; the remote schema name and LIMIT TO and EXCEPT table names used by IMPORT FOREIGN SCHEMA; and the sql_mode option used in SET sql_mode.
What version contains the fix?
The issue is fixed in mysql_fdw 2.10.0. That version escapes the affected names and restricts sql_mode to letters, digits, underscores, and commas.