CVE-2026-139877
mysql2 SQL injection
- Published30 Nov 2026
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.
CVSS 4.0 breakdown
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:XRemediation
No fixed version is recorded in the NVD data. Check the vendor advisory for the latest guidance.
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
Related CVEs
Recent high-severity vulnerabilities sharing a weakness type.
Frequently asked
Is CVE-2026-139877 being actively exploited?
CVE-2026-139877 is not in the CISA KEV catalog.
How severe is CVE-2026-139877?
CVE-2026-139877 has a CVSS 4.0 base score of 9.1, rated critical.
How do I fix CVE-2026-139877?
Apply the vendor's patch or advisory guidance, then verify no affected versions remain across your devices.
How Secuno handles this
Secuno correlates vulnerabilities like CVE-2026-139877 against the real software inventory on every managed device, as each hourly inventory arrives. Rather than a static severity, each match is scored in context: exploit availability, EPSS, the asset's exposure, and business criticality decide where it lands in the queue. If an affected version is present anywhere across your portfolio, it surfaces automatically with a prioritised remediation path.
Data from the NVD, CISA KEV catalog and FIRST EPSS. The CVSS 4.0 base score is shown where the NVD has one, otherwise CVSS 3.1.