CVE-2026-139877
published critical CVSS 4.0 · 9.1mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| sidorares | — | mysql20 to < 3.25.0 · Other versions: unaffected | Affected | Not stated | VulnCheck |
Description
mysql2 before 3.25.0 contains an sql injection vulnerability in Connection.format() and Connection.escape() because quotes are always backslash-escaped regardless of session SQL mode. When NO_BACKSLASH_ESCAPES is enabled, attackers can pass crafted values through ? placeholders in connection.query() to close string literals and append SQL, disclosing or modifying data.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 9.1 / 10
- Severity
- critical
- Provider
- VulnCheck · cna
- Vector string
- CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 7.4 | high | VulnCheck · cna | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| sidorares | mysql2 | 0 to < 3.25.0 (affected · semver)Default: unaffected | VulnCheck · cna |
Weaknesses
1- CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
References
5- https://github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675
- https://github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea
- mysql2 v3.25.0 Release Notes https://github.com/sidorares/node-mysql2/releases/tag/v3.25.0
- GitHub Security Advisory (GHSA-f763-mv98-7rv9) https://github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9
- VulnCheck Advisory: mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES https://www.vulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes
Provider assertions
1VulnCheck · cna
mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 36b87da12f09619cdc94081959e8ffee8edf0fb7ef11e955cd5e61845ee2e5ec
- Ingested
- 30 Nov 2026, 18:38:27 UTC
- Source record
- Official CVE record