Bug 2587462 (CVE-2026-139877)

Summary: CVE-2026-139877 mysql2: mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: abarbaro, alizardo, jchui, jhe, jlanda, kaycoth, kshier, ktsao, nboldt, oaljalju, psrna, rbobbitt, rhel-process-autobot, simaishi, stcannon, watson-tool-maintainers, yguenane
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in mysql2. The library improperly handles character escaping when the database is configured to ignore backslash escape characters. A remote attacker can exploit this vulnerability by submitting crafted input through query placeholders to perform a Structured Query Language (SQL) injection. This allows the attacker to access or modify sensitive database records.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2590267    
Bug Blocks:    

Description OSIDB Bzimport 2026-11-30 16:32:32 UTC
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.