CVE-2026-139877
mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES
9.1 CRITICALEPSS 0.78%Not in KEVNVD: Received
Overview
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.
Severity
| Score | Severity | Version | Technologies Affected |
|---|---|---|---|
| 9.1 | CRITICAL | 4.0VulnCheck (CNA) | Sidorares Mysql2 |
| 7.4 | HIGH | 3.1VulnCheck (CNA) |
Details
- CVE ID
- CVE-2026-139877
- Status
- Received
- Assigner (CNA)
- VulnCheck
- Published
- Nov 30, 2026
- Last modified
- Nov 30, 2026, 5:18 PM UTC
- Weaknesses
- CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Products
As published by the CNA in the CVE record.
sidoraresmysql21 version range
- before 3.25.0
References
- github.com https://github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675
- github.com https://github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea
- github.com https://github.com/sidorares/node-mysql2/releases/tag/v3.25.0
- github.com https://github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9
- vulncheck.com https://www.vulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes