CVE-2015-9244: SQL Injection in mysql

mysql Updated 02 Oct 2025

Summary

01/09/2020
Yes i
Moderate
Not published

CVE-2015-9244: SQL Injection in mysql. Affects mysql versions < 2.0.0-alpha8. Fixed in 2.0.0-alpha8. How to fix ↓

Also tracked for

The same CVE-2015-9244 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The mysql package is an npm package that provides a MySQL client for Node.js applications. It allows developers to interact with MySQL databases using JavaScript. The package is widely used in Node.js projects for database operations.

Vulnerability Detail

Versions of mysql prior to 2.0.0-alpha8 are affected by a SQL Injection vulnerability in the mysql.escape() function. This vulnerability arises due to improper escaping of object keys. An attacker can exploit this vulnerability by injecting malicious SQL queries through unescaped object keys, potentially leading to unauthorized access, data manipulation, or other malicious activities.

How To Fix

Minimum fixed version

2.0.0-alpha8

This is the first release that contains the fix.

npm install mysql@2.0.0-alpha8

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. However, developers can manually sanitize and escape object keys before passing them to the mysql.escape() function to prevent SQL Injection attacks. Here is an example of how to sanitize object keys using the mysql.escapeId() function:

const mysql = require('mysql');

const obj = {
  'key1': 'value1',
  'key2': 'value2',
  'key3': 'value3'
};

const sanitizedObj = {};

for (const key in obj) {
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
    sanitizedObj[mysql.escapeId(key)] = obj[key];
  }
}

console.log(sanitizedObj);

Conclusion

The SQL Injection vulnerability in the mysql package prior to version 2.0.0-alpha8 can lead to unauthorized access, data manipulation, or other malicious activities on the MySQL database. It is crucial to update to the latest version to mitigate this vulnerability. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for mysql →

Share this vulnerability

FAQ

This vulnerability can allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data manipulation, or other malicious activities on the MySQL database.

No, only versions prior to 2.0.0-alpha8 are affected. Updating to version 2.0.0-alpha8 or later mitigates the vulnerability.

There is no known exploit available for this vulnerability at the moment. However, it is important to update to the latest version to prevent any potential exploitation.

Yes, you can manually sanitize and escape object keys before passing them to the mysql.escape() function. This can help prevent SQL Injection attacks. Refer to the provided workaround for an example.

Related vulnerabilities

Recent vulnerabilities recorded for mysql.

How To Fix

Minimum fixed version

2.0.0-alpha8

This is the first release that contains the fix.

npm install mysql@2.0.0-alpha8

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.