home / blog
2026-11-30 · high
CVE-2026-139877: SQL Injection Vulnerability in mysql2
CVE-2026-139877: SQL Injection vulnerability in mysql2. High impact on systems using outdated libraries.

CVE-2026-139877 is a SQL injection vulnerability in the mysql2 library for Node.js, present in versions before 3.25.0. The issue lies in the Connection.format() and Connection.escape() methods, which do not properly handle quote escaping when NO_BACKSLASH_ESCAPES SQL mode is enabled. This allows an attacker to close string literals and inject malicious SQL code through query placeholders, potentially reading or modifying database data.
The vulnerability has a CVSS score of 7.4 (high) and has been officially classified as critical. Community signals indicate the vulnerability is receiving attention, with 2 posts in the last 24 hours and a total of 5 interactions. The issue is verified and documented by NVD with publication on November 30, 2026.
For defense, it is essential to promptly apply the patch by updating mysql2 to version 3.25.0 or later. For systems that cannot be immediately updated, it is recommended to verify the SQL mode configuration and disable NO_BACKSLASH_ESCAPES if not strictly necessary. Monitor for suspicious queries and implement additional controls on applications using mysql2.
At a glance
- What
- SQL injection vulnerability in mysql2 before 3.25.0 in Connection.format() and Connection.escape() methods
- Severity
- 7.4 (high)
- Affected versions
- mysql2 before 3.25.0
- Fix
- Update to mysql2 version 3.25.0 or later
- Status
- Officially published on 2026-11-30
- Action
- Apply patches or update to version 3.25.0 or later
Sources: NVD, CVE-2026-139877