CVE-2026-107385: Mariadb SQL Injection Vulnerability
HIGHCVE-2026-107385 is a HIGH (CVSS 7.4) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Mariadb libraries in the npm ecosystem. The issue involves sql injection in the text protocol when the session uses no_backslash_escapes. Remediation is available by upgrading affected packages to version 3.2.5, 3.3.4, 3.4.7, 3.5.4.
CVE-2026-107385 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H).
How to Fix CVE-2026-107385
To remediate this vulnerability, upgrade all affected Mariadb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install mariadb@3.2.5
npm install mariadb@3.3.4
npm install mariadb@3.4.7
npm install mariadb@3.5.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mariadb
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-107385, inspect your project dependencies using npm:
npm ls mariadb
Analyze the terminal output to locate any version of Mariadb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.5), your application is affected.
Note: The npm ls mariadb command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where 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. In Mariadb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-107385 Affected Mariadb Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mariadb
|
npm |
< 3.2.5
|
3.2.5
|
|
mariadb
|
npm |
≥ 3.3.0
< 3.3.4
|
3.3.4
|
|
mariadb
|
npm |
≥ 3.4.0
< 3.4.7
|
3.4.7
|
|
mariadb
|
npm |
≥ 3.5.0-rc.0
< 3.5.4
|
3.5.4
|
References
Frequently Asked Questions
What is CVE-2026-107385?
Which Mariadb versions are affected?
What version fixes CVE-2026-107385?
Is mariadb affected?
What is the CVSS score of CVE-2026-107385?
What CWE is associated with CVE-2026-107385?
How can I check npm dependencies for CVE-2026-107385?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r3rv-jm3r-62q2",
"modified" : "2026-10-08T19:42:29Z",
"published" : "2026-10-08T19:42:28Z",
"aliases" : [ "CVE-2026-107385" ],
"summary" : "MariaDB Connector/Node.js: SQL injection in the text protocol when the session uses NO_BACKSLASH_ESCAPES",
"details" : "### Description\nWhen 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.\n\nUnder 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.\n\nAll text-protocol escaping entry points were affected, including Connection.escape().\n\n### Impact\nAn 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.\n\nExposure 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.\n\nexecute() and batch() are not affected: the binary prepared-statement and bulk protocols send parameter values out of band.\n\n### Resolution\nThe escaping routines now branch on the session status flag, doubling the quote and leaving the backslash untouched when NO_BACKSLASH_ESCAPES is set\n\n### Workarounds\nUse execute() or batch(), or do not enable NO_BACKSLASH_ESCAPES, until upgraded.\n\n### Credit\nReported by fg0x0.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.2.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.3.0"
}, {
"fixed" : "3.3.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.4.0"
}, {
"fixed" : "3.4.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.5.0-rc.0"
}, {
"fixed" : "3.5.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/security/advisories/GHSA-r3rv-jm3r-62q2"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/6995c8cf8e51b2ad055de63dcaa4094eebbef5ce"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/7670d90949307e735c0ae148d80b3776478a599d"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/95886df9fa0cca991e2be339caa6c3979be61553"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/e5a9d732d9574177749488336319b73074072779"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/3889197"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.2.5"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.3.4"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.4.7"
}, {
"type" : "WEB",
"url" : "https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases/tag/3.5.4"
}, {
"type" : "WEB",
"url" : "https://jira.mariadb.org/browse/CONJS-368"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-08T19:42:28Z",
"nvd_published_at" : null
}
}