CVE-2026-139877 — sidorares mysql2
Summary
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.
Severity breakdown
Critical · 9.1
An attacker without an account can exploit this over the network, without any user action, but only under specific conditions.
- Attack from
- the network (remotely)
- Attack complexity
- high (only works under specific conditions)
- Special conditions
- only in some setups or conditions
- Login needed
- no
- User action needed
- no
- Impact
- high on confidentiality and integrity, none on availability
- Impact on other systems
- none
Weakness
- CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| sidorares mysql2 | < 3.25.0 | 3.25.0 |
References by type
Vendor advisories
Patches and fixed releases
- github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e4…
- github.com/sidorares/node-mysql2/releases/tag/v3.25.0
Other references
Affected
- sidorares mysql2
What to do
- Check whether you run an affected product or version and apply the vendor's update or mitigation.
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-139877?
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 NOBACKSLASHESCAPES is enabled, attackers can pass crafted values through ? placeholders in connection.query() to close string literals and append SQL, disclosing or modifying data. Weakness type: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (CWE-89).
How severe is CVE-2026-139877?
CVE-2026-139877 has a CVSS 4.0 base score of 9.1 (critical), from the CNA (vulncheck.com). An attacker without an account can exploit this over the network, without any user action, but only under specific conditions.
Is CVE-2026-139877 being exploited?
Not as far as is known: CVE-2026-139877 is not in CISA's Known Exploited Vulnerabilities catalog as of November 30, 2026.
Which versions are affected by CVE-2026-139877?
sidorares mysql2 < 3.25.0 (fixed in 3.25.0).
How do I fix CVE-2026-139877?
Update to a fixed release: sidorares mysql2 3.25.0.