CVE-2026-139877
7.4HighPublished Nov 30, 2026 · NVD status: Received · AI triage by gemini-3.1-flash-lite
High
0CVSS v3.110
- Attack vector
- Network
- Complexity
- High
- Privileges
- None
- User action
- None
- Impact
- High impact on confidentiality, integrity
- Weakness
- CWE-89
What an attacker gets
Remote attackers can inject arbitrary SQL commands to read or modify database data. This requires the application to use the NO_BACKSLASH_ESCAPES SQL mode.
Root cause
The library incorrectly escapes quotes using backslashes even when the database session is configured with NO_BACKSLASH_ESCAPES.
Affected versions
mysql2 before 3.25.0
CVSS v3.1 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Fix & remediation
Upgrade to mysql2 version 3.25.0 or later. If you cannot upgrade, disable the NO_BACKSLASH_ESCAPES SQL mode in your database configuration.
$ npm install mysql2@latestAI-suggested. Run it in staging first and check it against the vendor advisory. Why?
NVD 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.
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 Critical / High CVEs
More fully triaged vulnerabilities you may want to check next.
- CVE-2026-1399907.5HighUnauthenticated attackers can extract database contents via time-based blind SQL injection. They only need network access to the GLPI web interface.
- CVE-2026-1399897.8HighAttackers can execute arbitrary code with the privileges of the process using the library. This requires a user to load a malicious Hugging Face model containing a crafted chat_template.
- CVE-2026-1398177.3HighRemote attackers can trigger an out-of-bounds write by manipulating the max_seqlen_k argument. This can lead to memory corruption or arbitrary code execution.
- CVE-2026-1371899.3CriticalUnauthenticated remote attackers can bypass access controls to modify Jupyter backend configurations or access health endpoints. This is possible because the server trusts the client-supplied Host header to verify request origin.
- CVE-2026-1371868.7HighAuthenticated attackers can execute arbitrary OS commands on the host. This occurs during the installation of a STDIO MCP server before sandboxing is applied.
- CVE-2026-1371857.3HighAttackers can execute arbitrary code outside the project root as the process user. This requires the attacker to influence a model-issued command and, in default mode, requires human approval.