CVE-2026-139877
critical · 9.1mysql2 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.
9.1
CVSS
0.8%
EPSS (exploit prob.)
57th
EPSS percentile
2026-11-30
Published
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Weaknesses
CWE-89
References
- https://github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675
- https://github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea
- https://github.com/sidorares/node-mysql2/releases/tag/v3.25.0
- https://github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9
- https://www.vulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes
- https://github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9
Query this programmatically:
curl https://evil-db.io/api/v1/cve/CVE-2026-139877