mysql2 before 3.25.0 contains an sql injection vulnerability in Connection.format() and Connection.escape() because
Source GCVE Database
Not known to be exploited · CVSS 9.1 Critical : upgrade to 3.25.0 as a priority.
Data as of 30 Nov 2026, 19:59 UTC
Thin evidence
One scorer or none| CNA (VulnCheck) | CVSS 4.0 | 9.1 |
|---|---|---|
| CNA (VulnCheck) | CVSS 3.1 | 7.4 |
- Patch
- Available – fixed in 3.25.0
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 30 Nov 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Nov 2026.
What to do
Upgrade mysql2 to 3.25.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
npmmysql2pkg:npm/mysql2Other threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade mysql2 to version 3.25.0 or later where this vulnerability is fixed. No vendor advisory or patch links are provided in the data, but the fixed version is explicitly stated. Until upgrading, avoid enabling NO_BACKSLASH_ESCAPES SQL mode or do not use untrusted input in query placeholders. Patch status is confirmed by the fixed version indication.
Description
mysql2 versions prior to 3.25.0 contain an SQL injection vulnerability in the Connection.format() and Connection.escape() functions. This occurs because quotes are always backslash-escaped regardless of the session's SQL mode. When the NO_BACKSLASH_ESCAPES mode is enabled, attackers can craft input via ? placeholders in connection.query() to prematurely close string literals and append malicious SQL, potentially disclosing or modifying data.
References
- github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-139877 (opens in a new tab)
- github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea (opens in a new tab)
- github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js (opens in a new tab)
- github.com/sidorares/node-mysql2/releases/tag/v3.25.0 (opens in a new tab)
- vulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes (opens in a new tab)