/

CVE-2026-44172

Severity:

CRITICAL RISK

(9.1)

SQL Injection (CWE-89) via Big5 Escaping in MariaDB

CVE-2026-44172

Modified

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL execution with potential full data compromise

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection weakness in MariaDB affects applications that rely on mysql_real_escape_string() together with the text protocol and the Big5 character set.

When unvalidated user input is escaped this way and sent to the database, attackers may still inject arbitrary SQL, potentially leading to complete data compromise.

Affected context

This vulnerability arises in applications that:

  • Accept raw user-controlled input for SQL queries
  • Attempt to sanitize it using mysql_real_escape_string() or equivalent escaping
  • Communicate with MariaDB/MySQL using the text protocol
  • Use the Big5 character set for the database connection or schema

In this context, the escaping routine does not reliably neutralize dangerous characters for Big5-encoded data, leaving injection vectors open despite attempted sanitization.

Exploit preconditions

  • Attack surface: Application inputs that are concatenated into SQL statements and sent over the text protocol.
  • Required access: Ability to supply or influence data fields that become part of SQL queries (e.g., form fields, query parameters, headers).
  • Trigger point: Execution of dynamically constructed SQL strings that have only been passed through mysql_real_escape_string() while using the Big5 character set.
  • Why exploitation is possible: The escaping logic is not fully compatible with Big5 multibyte encoding, allowing crafted byte sequences to bypass or break out of the intended quoting context and inject additional SQL tokens.

Why this happens

The root cause is reliance on string escaping as a primary defense for dynamically built SQL, combined with character-set nuances that the escaping routine does not correctly handle.

In multibyte encodings such as Big5, certain byte sequences can be interpreted differently by the server than by the escaping function, creating gaps where quotes or control characters are not effectively neutralized.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where user-controlled data is incorporated into SQL syntax without robust, context-aware parameterization.

Potential impact

  • Attackers may inject arbitrary SQL commands into queries.
  • Data stored in the affected database can be read, modified, or deleted.
  • Application authentication and authorization data may be exposed or tampered with.
  • Logic embedded in stored procedures or triggers can be abused to escalate impact.
  • In some environments, SQL-level compromise can aid in broader system or infrastructure access.

General mitigation guidance

Mitigation typically focuses on eliminating SQL construction patterns that concatenate user input and depend on escaping.

Safer patterns include:

  • Using parameterized queries and prepared statements for all dynamic SQL, independent of character set.
  • Structuring queries so that user input is always treated as data, never as SQL syntax (e.g., no dynamic column or table names derived directly from user input).
  • Minimizing reliance on connection-level character sets that are historically error-prone for security-sensitive parsing, when possible.
  • Applying strict input validation and whitelisting for fields that must influence SQL structure (such as sort order or limited enumerated values).
  • Running database accounts with least privilege to reduce the blast radius of any successful injection.

How teams detect issues like this

Detection typically involves reviewing both application code and database interaction patterns:

  • Static analysis rules that flag string concatenation used to assemble SQL, especially when paired with escaping routines instead of parameter binding.
  • Code review checklists that explicitly verify use of prepared statements for any user-influenced query components.
  • Logging and monitoring of database queries to identify anomalous patterns, such as unexpected operators, stacked statements, or tautological conditions originating from user inputs.
  • Security scanning tools and dynamic analysis that attempt to inject typical SQL payload patterns into exposed input fields to detect vulnerable paths.
  • Policy enforcement in CI/CD pipelines that disallow new usages of raw SQL string concatenation with user inputs without parameters.

Sources

SourceLink
github.comgithub.com/MariaDB/server/security/advisories/GHSA-pv9p-5w55-55jm
jira.mariadb.orgjira.mariadb.org/browse/CONC-819
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30135
access.redhat.comaccess.redhat.com/errata/RHSA-2026:43505
access.redhat.comaccess.redhat.com/errata/RHSA-2026:47772
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-44172
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2488459
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44172.json

Frequently asked

questions

Yes. If an application exposes network-accessible inputs that are incorporated into SQL queries using the affected pattern, an attacker can exploit the issue remotely through normal application interfaces.

The attacker only needs the ability to submit or control data that reaches SQL query construction, such as web form fields, query parameters, or API request bodies. No direct database credentials are required if the application acts as the intermediary.

The most robust fix is to replace query-building that relies on mysql_real_escape_string() with parameterized queries and prepared statements, ensuring user input is always bound as data values. Where query structure must be dynamic, constrain it to validated, whitelisted options separate from free-form user data.

Adopt a development standard that forbids concatenating user input into SQL, mandate parameterized queries for all database interactions, and include automated checks in code review and CI. Additionally, maintain clear documentation on safe database access patterns and train developers about character set and escaping pitfalls.

Find out what's already
exploitable in your codebase.