Intel

AIKIDO-2026-10224

mysql is vulnerable to SQL Injection

SQL Injection Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Feb 22, 2026

75

High Risk

This Affects:

JSmysql
0.0.1 - 2.18.1
Are you affected? Scan for Free

TL;DR

Affected versions of this package contain an SQL injection vulnerability due to inconsistent escape behavior based on parameter value types. The library’s escape functions (connection.escape(), mysql.escape(), pool.escape()) handle different types (e.g., strings, numbers, objects) differently, and when non-string types such as Object are passed into parameterized queries, the resulting SQL can be altered in unexpected ways that allow an attacker to inject SQL logic and bypass intended controls. This can lead to authentication bypass and other injection impacts even in code that appears to use proper escaping. The root cause is the escape logic’s type-dependent behavior, and mitigation requires enforcing strict type handling or configuration (such as enabling stringifyObjects) before executing queries to ensure safe escaping of all input types.

Who does this affect?

You are affected if you are using this library.

Background info

mysql is vulnerable to SQL Injection in versions 0.0.1 - 2.18.1.

How to fix this

Upgrade to the mysql2 library, version 3.17.0 or higher.