CVE-2026-107385
JSON

7.4high

MariaDB Connector/Node.js: SQL injection in the text protocol when the session uses NO_BACKSLASH_ESCAPES

Severity
7.4high CVSS:3.1 by GitHub_M
Exploit likelihood
0.55% (higher than 47% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-r3rv-jm3r-62q2BIT-MARIADB-2026-107385BIT-MARIADB-MIN-2026-107385BIT-MYSQL-CLIENT-2026-107385

Description

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. Prior to 3.2.5, 3.3.4, 3.4.7, and 3.5.4, text-protocol escaping always prefixes quotes with a backslash and does not honor the session's NO_BACKSLASH_ESCAPES mode, including in Connection.escape(). When that mode is enabled, the backslash is an ordinary character, so an attacker-controlled placeholder value can close the SQL string literal and inject arbitrary SQL with the application's database privileges. The vulnerable configuration may be enabled server-wide, through connector initialization options, or with an application-issued SET sql_mode; execute() and batch() use binary protocols and are not affected. This issue is fixed in versions 3.2.5, 3.3.4, 3.4.7, and 3.5.4.

Affected

Product or packageVersionsReported by
mariadb-corporation mariadb-connector-nodejs< 3.2.5, >= 3.3.0, < 3.3.4, >= 3.4.0, < 3.4.7, >= 3.5.0-rc.0, < 3.5.4CVE List
mariadb (npm)before 3.2.5, from 3.3.0 before 3.3.4, from 3.4.0 before 3.4.7, from 3.5.0-rc.0 before 3.5.4GitHub Advisory Database
mariadb (Bitnami)before 3.2.5, from 3.3.0 before 3.3.4, from 3.4.0 before 3.4.7, from 3.5.0 before 3.5.4Bitnami Vulnerability Database
mariadb-min (Bitnami)before 3.2.5, from 3.3.0 before 3.3.4, from 3.4.0 before 3.4.7, from 3.5.0 before 3.5.4Bitnami Vulnerability Database
mysql-client (Bitnami)before 3.2.5, from 3.3.0 before 3.3.4, from 3.4.0 before 3.4.7, from 3.5.0 before 3.5.4Bitnami Vulnerability Database

All scores

GitHub_M7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
GitHub7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
Bitnami Vulnerability Databasehigh rating

Classification

CWE-89

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. Prior to 3.2.5, 3.3.4, 3.4.7, and 3.5.4, text-protocol escaping always prefixes quotes with a backslash and does not honor the session's NO_BACKSLASH_ESCAPES mode, including in Connection.escape(). When that mode is enabled, the backslash is an ordinary character, so an attacker-controlled placeholder value can close the SQL string literal and inject arbitrary SQL with the application's database privileges. The vulnerable configuration may be enabled server-wide, through connector initialization options, or with an application-issued SET sql_mode; execute() and batch() use binary protocols and are not affected. This issue is fixed in versions 3.2.5, 3.3.4, 3.4.7, and 3.5.4.

GitHub Advisory Database
Description

When escaping string and binary parameters for the text protocol, the connector always escaped the quote character with a backslash, without ever consulting the session's NO_BACKSLASH_ESCAPES SQL mode. The server status flag was declared (STATUS_NO_BACKSLASH_ESCAPES) but never read.

Under a server or session running with NO_BACKSLASH_ESCAPES, the backslash is an ordinary character and the quote must be escaped by doubling it. The escaped value produced by the connector therefore closed the string literal, and a value passed through a placeholder was interpreted as SQL.

All text-protocol escaping entry points were affected, including Connection.escape().

Impact

An attacker able to influence any value the application passes as a query parameter could execute arbitrary SQL with the privileges of the application's database user: read, modify or delete any data reachable by that connection.

Exposure requires a deployment where NO_BACKSLASH_ESCAPES is enabled — server-wide, through the connector's sessionVariables / initSql options, or by an application-issued SET sql_mode. It is not implied by the ANSI, ORACLE or TRADITIONAL compound modes on MariaDB 11.4, so it has to be set deliberately. Where it is enabled, no unusual application code is needed: the standard placeholder API is the injection point.

execute() and batch() are not affected: the binary prepared-statement and bulk protocols send parameter values out of band.

Resolution

The escaping routines now branch on the session status flag, doubling the quote and leaving the backslash untouched when NO_BACKSLASH_ESCAPES is set

Workarounds

Use execute() or batch(), or do not enable NO_BACKSLASH_ESCAPES, until upgraded.

Credit

Reported by fg0x0.

References

https://github.com/mariadb-corporation/mariadb-connector-nodejs/security/advisories/GHSA-r3rv-jm3r-62q2web
https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/6995c8cf8e51b2ad055de63dcaa4094eebbef5ceweb
https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/7670d90949307e735c0ae148d80b3776478a599dweb
https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/95886df9fa0cca991e2be339caa6c3979be61553web
https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/e5a9d732d9574177749488336319b73074072779web
https://hackerone.com/reports/3889197web
https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.2.5web
https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.3.4web
https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.4.7web
https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.5.4web
https://jira.mariadb.org/browse/CONJS-368web
https://github.com/mariadb-corporation/mariadb-connector-nodejspackage

Sources

SourceRecordLicence
CVE ListCVE-2026-107385 changed 2026-10-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-r3rv-jm3r-62q2 changed 2026-10-16CC-BY-4.0
NVDCVE-2026-107385 changed 2026-10-09Public domain
Bitnami Vulnerability DatabaseBIT-MARIADB-2026-107385 changed 2026-10-16Apache-2.0
Bitnami Vulnerability DatabaseBIT-MARIADB-MIN-2026-107385 changed 2026-10-16Apache-2.0
Bitnami Vulnerability DatabaseBIT-MYSQL-CLIENT-2026-107385 changed 2026-10-16Apache-2.0