CVE-2026-62151 - mysql_fdw SQL injection through a multi-byte character set escaping bypass

First Published: 2026/11/25

Last Updated: 2026/11/25

Summary

mysql_fdw builds string literals for queries sent to the remote MySQL server with an escaping routine that is not character-set aware. When the connection uses a multi-byte character set such as GBK, SJIS or Big5 and MySQL's default backslash escaping is in effect, a crafted value whose trailing byte is 0x5C absorbs the escaping backslash and leaves the following quote unescaped. The routine handles every pushed-down string constant, including ordinary WHERE-clause literals, so an authenticated user with only SELECT on a foreign table can break out of the literal and run arbitrary SQL on the remote MySQL server with the credentials of the user mapping.

Vulnerability details

CVE-ID: CVE-2026-62151

CVSS Base Score: 5.8 Medium

CVSS Temporal Score: Undefined

CVSS Environmental Score: Undefined

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H

Affected products and versions

  • Affected Product: MySQL Foreign Data Wrapper (mysql_fdw)
  • Affected Versions: mysql_fdw 2.9.3 and earlier, on all supported PostgreSQL and EDB Postgres Advanced Server versions

Remediation/fixes

Impacted users must upgrade to mysql_fdw 2.10.0 or later. From mysql_fdw 2.10.0, mysql_fdw forces NO_BACKSLASH_ESCAPES into the session sql_mode and escapes string literals by doubling single quotes.

ProductVRMFRemediation/First Fix
mysql_fdw2.9.3 and earlierUpdate to mysql_fdw 2.10.0 or later

Mitigation

Until you can upgrade, reduce exposure as follows:

  • Avoid GBK, SJIS and Big5 as the character set for mysql_fdw connections.
  • Grant the MySQL account used in user mappings only the privileges the foreign tables need.

References

Acknowledgement

Source: Discovered internally by EDB during a security review of mysql_fdw.

Change history

  • 2026/11/25: Original Copy Published

Disclaimer

This document is provided on an "as is" basis and does not imply any kind of guarantee or warranty, including the warranties of merchantability or fitness for a particular use. Your use of the information on the document is at your own risk. EDB reserves the right to change or update this document at any time. Customers are therefore recommended to always view the latest version of this document.


Could this page be better? Report a problem or suggest an addition!