mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES

Patch this weekData theft and tampering over the network, no login needed.
9.1CRITICAL

CVE-2026-139877

Key Information:

Vendor

Sidorares

Status
Mysql2
CVE ID
CVE ID:
CVE-2026-139877
Vendor
CVE Published:
30 November 2026
Fixed in
Fixed in:
3.25.0

Timeline

Trending 1 day after it was published

  • 📈

    Vulnerability started trending

  • Vulnerability published

  • Vulnerability Reserved

Badges

🔥 Trending now📈 Trended📈 Score: 3,680

How risky is it?

  • Yes: Works over the network, no login needed
  • No: No public exploit yet
  • No: Not on CISA's exploited list
  • No: No ransomware use seen

Our verdict

Patch this week

Exploitation is likely. Prioritise the fix.

What to do

1Update to a fixed version
mysql2 0 to below 3.25.0 is vulnerable
Install mysql2 3.25.0 or later
Read the vendor advisory ↗
2Can't patch yet? Reduce exposure

It can be reached over the network, so limit who can reach mysql2. Block it from the internet, allow only trusted hosts or a VPN, and turn off the affected feature if you don't use it, until you can update.

3Why it's rated "Patch this week"
  • It can be exploited remotely without credentials.
  • Its CVSS severity is critical (9.1).

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 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

Facts on this page come from the sources listed above; the writeup is AI-assisted. How we rate vulnerabilities · Report a correction

CVSS V4

Score:
9.1
Severity:
CRITICAL
Confidentiality:
High
Integrity:
High
Availability:
None
Attack Vector:
Network
Attack Complexity:
High
Attack Required:
Physical
Privileges Required:
Undefined
User Interaction:
None

Credit

Vishal Suwalka
secondseccve
.