GHSA-XM4V-PWJ4-92QV
SQL injection through Pool.escape() under NO_BACKSLASH_ESCAPES when every pool connection is in use
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 3.2.6 | mariadb · -7 d desde divulgación | |
| Remediación | Parche 3.3.5 | mariadb · -7 d desde divulgación | |
| Remediación | Parche 3.4.8 | mariadb · -7 d desde divulgación | |
| Remediación | Parche 3.5.5 | mariadb · -7 d desde divulgación | |
| Divulgación | Publicada | GHSA-XM4V-PWJ4-92QV divulgada · CVSS 7.4 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Description
The fix for CVE-2026-107385 (GHSA-r3rv-jm3r-62q2) made the escaping routines follow the session's NO_BACKSLASH_ESCAPES mode, read from the connection's status. Pool.escape() and PoolCluster.escape() take that status from one of the pool's connections. The lookup only read an idle connection; its fallback over the connections in use iterated array indexes instead of thread identifiers, so it found nothing. When every connection of the pool was in use, Pool.escape() had no session state and fell back to backslash escaping.
Under NO_BACKSLASH_ESCAPES, the backslash is an ordinary character and the quote must be doubled: the value returned by Pool.escape() closed the string literal, and the rest of the value was parsed as SQL. A saturated pool is the normal state of a loaded application, so the window is not exotic.
Connection.escape() and the placeholder APIs were not affected. execute() and batch() are not affected: the binary protocol sends values out of band.
### Impact
An attacker able to influence a value the application escapes with Pool.escape() under NO_BACKSLASH_ESCAPES 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 or initSql options, or by an application-issued SET sql_mode, and the use of Pool.escape() while every connection of the pool is in use.
### Resolution
The pool now reads the session state from any of its connections, idle or in use. When the pool has no connection at all, Pool.escape() throws instead of escaping with a mode it cannot know.
### Patches
Fixed in 3.2.6, 3.3.5, 3.4.8 and 3.5.5. Upgrade to the patched release of your branch.
### Workarounds
Use placeholders, execute() or batch(), or Connection.escape() on a connection obtained from the pool, or do not enable NO_BACKSLASH_ESCAPES, until upgraded.
### References
CONJS-378: https://jira.mariadb.org/browse/CONJS-378
Fix commit: https://github.com/mariadb-corporation/mariadb-connector-nodejs/commit/4c8792d
### Credit
Reported by buxuwa and Kaya Emre Arikan
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmmariadb |
Corregida | 3.2.6, 3.3.5, 3.4.8, 3.5.5 | -7 d · -7 d · -7 d · -7 d | 3.5.5 no afectada |
3.2.63.3.53.4.83.5.5Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/mariadb-corporation/mariadb-connector-nodejs/security/advisories/GHSA-xm4v-pwj4-92qvLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
