Vulnerability in mysql Node.JS Module: Remote Memory Exposure

mysql Updated 02 Oct 2025

Summary

23/05/2019
MODERATE
Yes i
Moderate
Not published

GHSA-5f7m-mmpc-qhh4: mysql Node.JS Module Vulnerable to Remote Memory Exposure. Affects mysql versions >= 2.0.0-alpha8, < 2.14.0. Fixed in 2.14.0. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The mysql Node.js module is a popular package used for connecting to MySQL databases from Node.js applications. It provides a convenient way to interact with MySQL databases and execute queries. However, versions of the mysql package before 2.14.0 are vulnerable to remote memory exposure.

Vulnerability Detail

The vulnerability in the mysql Node.js module occurs when a number is provided as a password. Affected versions of the package allocate and send uninitialized memory over the network, potentially exposing sensitive information. This vulnerability only affects mysql running on Node.js versions below 6.0.0, as newer versions of Node.js have added a throw to prevent this issue.

How To Fix

Latest published version: 2.18.1 as of 22 Oct 2026

npm install mysql@2.18.1

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.14.0

This is the first release that contains the fix.

npm install mysql@2.14.0

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

Workaround

If updating the mysql package is not immediately possible, a workaround can be implemented by ensuring that the password provided is not a number. This can be achieved by converting the password to a string before passing it to the mysql module. Here is an example of a workaround code snippet:

const password = String(USERPROVIDEDINPUT);

require('mysql').createConnection({
  host: 'localhost',
  user: 'user',
  password: password,
  database: 'my_db'
}).connect();

Conclusion

The mysql Node.js module versions before 2.14.0 are vulnerable to remote memory exposure when a number is provided as a password. It is recommended to update to version 2.14.0 or later to fix this vulnerability. If immediate update is not possible, a workaround can be implemented by converting the password to a string. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mysql →

Share this vulnerability

FAQ

Versions of the mysql package before 2.14.0 are affected by this vulnerability.

The vulnerability can potentially expose uninitialized memory over the network, which may contain sensitive information.

No, only Node.js versions below 6.0.0 are affected. Newer versions of Node.js have added a throw to prevent this issue.

Yes, updating to version 2.14.0 or later of the mysql package will fix this vulnerability.

If updating the mysql package is not possible, a workaround can be implemented by converting the password to a string before passing it to the mysql module.

Related vulnerabilities

Recent vulnerabilities recorded for mysql.

How To Fix

Latest published version: 2.18.1 as of 22 Oct 2026

npm install mysql@2.18.1

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.14.0

This is the first release that contains the fix.

npm install mysql@2.14.0

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