GHSA-r3rv-jm3r-62q2

Suggest an improvement
Source
https://github.com/advisories/GHSA-r3rv-jm3r-62q2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-r3rv-jm3r-62q2/GHSA-r3rv-jm3r-62q2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-r3rv-jm3r-62q2
Aliases
  • CVE-2026-107385
Published
2026-10-08T19:42:28Z
Modified
2026-10-08T20:00:06Z
Severity
  • 7.4 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H CVSS Calculator
Summary
MariaDB Connector/Node.js: SQL injection in the text protocol when the session uses NO_BACKSLASH_ESCAPES
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-08T19:42:28Z",
    "nvd_published_at": null,
    "severity": "HIGH"
}
References

Affected packages

npm / mariadb

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.2.5

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-r3rv-jm3r-62q2/GHSA-r3rv-jm3r-62q2.json"

npm / mariadb

Package

Affected ranges

Type
SEMVER
Events
Introduced
3.3.0
Fixed
3.3.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-r3rv-jm3r-62q2/GHSA-r3rv-jm3r-62q2.json"

npm / mariadb

Package

Affected ranges

Type
SEMVER
Events
Introduced
3.4.0
Fixed
3.4.7

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-r3rv-jm3r-62q2/GHSA-r3rv-jm3r-62q2.json"

npm / mariadb

Package

Affected ranges

Type
SEMVER
Events
Introduced
3.5.0-rc.0
Fixed
3.5.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-r3rv-jm3r-62q2/GHSA-r3rv-jm3r-62q2.json"