Skip to content

mysql_real_escape_string() incorrectly handled big5

Moderate
vuvova published GHSA-pv9p-5w55-55jm May 18, 2026

Package

libmariadb

Affected versions

3.3.18, 3.4.8

Patched versions

3.3.19, 3.4.9

Description

Impact

An application that was taking non-validated user input, escaping it with mysql_real_escape_string() and sending it to the database using text protocol and big5 character set was vulnerable to SQL injections, even though mysql_real_escape_string() was supposed to prevent them.

Workarounds

Switching to gbk character set can be used as a workaround.
Changing the application to use prepared statements as opposite to interpolating escaped parameters in the query string is always preferable as a general solution to SQL injections.

References

https://jira.mariadb.org/browse/CONC-819

Discovered by

Jun Rong at Calif.io

Severity

Moderate

CVE ID

CVE-2026-44172

Weaknesses

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. Learn more on MITRE.

Credits