CVE-2026-139877
Published:November 30, 2026
Updated:December 01, 2026
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 Packages
https://github.com/sidorares/node-mysql2.git (GITHUB):
Affected version(s) >=v0.8.4 <v3.25.0 || >=v1.0.0-rc.1 <v3.25.0 || >=v2.0.0-alpha1 <v3.25.0 || >=v3.0.0-rc.1 <v3.25.0Fix Suggestion:
Update to version v3.25.0mysql2 (NPM):
Affected version(s) >=0.1.0 <3.25.0 || >=1.0.0-rc.1 <3.25.0 || >=3.0.0-rc.1 <3.25.0 || >=2.0.0-alpha1 <3.25.0 || =3.24.7-canary.f4f9714 <3.25.0 || =3.24.7-canary.54cca37 <3.25.0 || =3.24.7-canary.b39481f <3.25.0 || =3.24.7-canary.b6806a9 <3.25.0 || =3.24.7-canary.caf5c5b <3.25.0 || =3.24.6-canary.8c068ef <3.25.0 || =3.24.7-canary.8b62839 <3.25.0 || =3.24.7-canary.a1234e6 <3.25.0 || =3.24.7-canary.f0feca2 <3.25.0 || =3.24.7-canary.51bc44d <3.25.0 || =3.24.7-canary.4cc59ff <3.25.0 || =3.24.7-canary.3df8fc4 <3.25.0 || =3.24.7-canary.a7839ff <3.25.0 || =3.24.7-canary.f2bdc77 <3.25.0 || =3.24.7-canary.25c88d2 <3.25.0Fix Suggestion:
Update to version 3.25.0Related ResourcesĀ (8)
Do you need more information?
Contact UsCVSS v4
Base Score:
9.1
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
PRESENT
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.4
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
NONE
Weakness Type (CWE)
Improper Neutralization of Special Elements used in an SQL Command
EPSS
Base Score:
0.63