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.
- CVSS
- 7.4High
- Chance of exploitation (EPSS)
- 0.78%
- Published
- Nov 30, 2026
- In the news
- Not yet
What to do
A serious SQL injection flaw in Sidorares Mysql2 that can be attacked over the network without logging in. Exploit code is public, so patch it soon.
Action: Check the vendor's advisory in the references and apply updates as soon as they are available.
Fixed in: 3.25.0
Affected versions
- Sidorares Mysql2
- Before 3.25.0
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.
Affected products
Get alerts for these →Timeline 2
Latest change: Xeyalm/CVE-2026-139877: mysql2: remote SQL injection in placeholder escaping (CVE-2026-139877) (Dec 1, 2026)
News, advisories, exploit code, scanner detection and exploitation, newest first.
Tue, Dec 1, 2026
- Exploit codeXeyalm/CVE-2026-139877: mysql2: remote SQL injection in placeholder escaping (CVE-2026-139877)GitHub (unverified) · 10:15 UTC
Mon, Nov 30, 2026
- CVECVE-2026-139877 published (CVSS 7.4)CVE Program · 17:18 UTC
Exploit code
Visit at your own risk. These are third-party sites we find automatically. We do not test, review or vouch for them, and fake proof-of-concept repositories sometimes contain malware.
- Xeyalm/CVE-2026-139877: mysql2: remote SQL injection in placeholder escaping (CVE-2026-139877)
GitHub, unverified · found Dec 1, 2026
References 6
- github.com /sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675
- github.com /sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea
- github.com /sidorares/node-mysql2/releases/tag/v3.25.0
- github.com /sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9
- www.vulncheck.com /advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes
- github.com /sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9