CVE-2026-107385: MariaDB Connector/Node.js: SQL injection in the text protocol when the session uses NO_BACKSLASH_ESCAPES
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 NOBACKSLASHESCAPES SQL mode. The server status flag was declared (STATUSNOBACKSLASHESCAPES) but never read.
Published Oct 8, 2026
Affected packages
mariadb
- Ecosystem
- npm
- Affected
- < 3.2.5
- Fixed in
- 3.2.5
- Check
npm ls mariadb
mariadb
- Ecosystem
- npm
- Affected
- >= 3.3.0, < 3.3.4
- Fixed in
- 3.3.4
- Check
npm ls mariadb
mariadb
- Ecosystem
- npm
- Affected
- >= 3.4.0, < 3.4.7
- Fixed in
- 3.4.7
- Check
npm ls mariadb
mariadb
- Ecosystem
- npm
- Affected
- >= 3.5.0-rc.0, < 3.5.4
- Fixed in
- 3.5.4
- Check
npm ls mariadb
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to fg0x0.
References
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/security/advisories/GHSA-r3rv-jm3r-62q2
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/6995c8cf8e51b2ad055de63dcaa4094eebbef5ce
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/7670d90949307e735c0ae148d80b3776478a599d
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/95886df9fa0cca991e2be339caa6c3979be61553
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/e5a9d732d9574177749488336319b73074072779
- https://hackerone.com/reports/3889197
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.2.5
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.3.4
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.4.7
- https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.5.4
- https://jira.mariadb.org/browse/CONJS-368
- https://github.com/advisories/GHSA-r3rv-jm3r-62q2
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-107382
MariaDB Connector/Node.js: Uncaught exception crashes the client during ed25519 authentication with zero-configuration TLS
medium5.9Oct 8, 2026CVE-2026-107383
MariaDB Connector/Node.js exposes uninitialized process memory through malformed GeoJSON parameters
high7.5Oct 8, 2026CVE-2026-107384
MariaDB Connector/Node.js: SQL injection through object keys in SET expansion (permitSetMultiParamEntries)
high8.1Oct 8, 2026CVE-2026-55215
MariaDB's connector leaks the cleartext password to an MitM despite `ssl: true`
high7.5Aug 28, 2026CVE-2026-55854
MariaDB has Cleartext Transmission of Sensitive Information and Insufficiently Protected Credentials
medium5.9Aug 28, 2026CVE-2026-55855
MariaDB has possible SQL injection in Buffer parameter escaping under big5/gbk/sjis/cp932/gb18030 client charsets
medium6.5Aug 28, 2026
