mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES
- State
- Published
- Severity
- 9.1 Critical
- Published
- Nov 30, 2026
- Updated
- Nov 30, 2026
- Reserved
- Nov 30, 2026
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.
| Product | Versions |
|---|---|
| mysql2 sidorares | before 3.25.0 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 9.1 Critical | VulnCheck | |
| 3.1 | 7.4 High | VulnCheck |
Weaknesses
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
References
- GitHub Security Advisory (GHSA-f763-mv98-7rv9)Vendor Advisory
- https://github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85eaPatch
- mysql2 v3.25.0 Release NotesRelease Notes
- https://github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675Technical Details
- VulnCheck Advisory: mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPESThird-Party Advisory
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.