Paper/Archive/CVE-2026-139877

CVE-2026-139877

sidorares mysql2 — mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES

Description · from the CVE record

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.

Affected

ProductAffectedFixed inSource
mysql2< 3.25.03.25.0CNA

Scores by source

VulnCheck (CNA)9.1CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
VulnCheck (CNA)7.4CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

References

advisorygithub.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9patchgithub.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85earefgithub.com/sidorares/node-mysql2/releases/tag/v3.25.0writeupgithub.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675writeupvulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes