---
title: "CVE-2026-139877: mysql2 - SQL Injection"
description: "mysql2 < 3.25.0 contains an SQL injection caused by improper escaping in Connection.format() and Connection.escape() when NO_BACKSLASH_ESCAPES mode is enabled, letting attackers disclose or modify data via crafted query placeholders."
url: https://panop.io/threat-heartbeat/CVE-2026-139877/
---

# CVE-2026-139877 mysql2 - SQL Injection

mysql2 < 3.25.0 contains an SQL injection caused by improper escaping in Connection.format() and Connection.escape() when NO\_BACKSLASH\_ESCAPES mode is enabled, letting attackers disclose or modify data via crafted query placeholders.

CVSS base score 7.4 /10

High

CISA KEV

Not listed

Public exploit

None known

Authentication

Not required

[View the NVD record ↗](https://nvd.nist.gov/vuln/detail/CVE-2026-139877)

## Details

Type

SQL Injection

Impact

SQL Injection, Information Disclosure, Data Tampering

CVSS vector

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Published

30 November 2026

Updated

1 December 2026

Weakness

[CWE-89](https://cwe.mitre.org/data/definitions/89.html)

## Vendor fix

Upgrade to version 3.25.0 or later.

Patching closes this CVE. It does not tell you which of your systems run the affected version, or what else is exposed alongside them.

## References

- [https://nvd.nist.gov/vuln/detail/CVE-2026-139877](https://nvd.nist.gov/vuln/detail/CVE-2026-139877)
- [https://github.com/sidorares/node-mysql2/releases/tag/v3.25.0](https://github.com/sidorares/node-mysql2/releases/tag/v3.25.0)
- [https://github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9](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](https://www.vulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes)
- [https://github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675](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/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea)

[← All CVEs](https://panop.io/threat-heartbeat/)

## What this record can't tell you

- Whether you run the affected software, and where
- Whether an attacker can actually reach and exploit it
- The misconfigurations that never get a CVE number
- What it would cost the business, ranked into what to fix first

Panop answers these inside your environment, for this CVE and every other finding.

[Book a demo](https://panop.io/demo)
