GHSA-5f7m-mmpc-qhh4: Mysql Mysql Node.JS Module Vulnerable To Vulnerability

MODERATE
CWE-201
Published
Advisory Summary

GHSA-5f7m-mmpc-qhh4 is a MODERATE mysql node.js module vulnerable to vulnerability (CWE-201: Insertion of Sensitive Information Into Sent Data) affecting Mysql libraries in the npm ecosystem. The issue involves mysql node.js module vulnerable to remote memory exposure. Remediation is available by upgrading affected packages to version 2.14.0.

GHSA-5f7m-mmpc-qhh4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5f7m-mmpc-qhh4
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-201: Insertion of Sensitive Information Into Sent Data
Affected Product Mysql
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-5f7m-mmpc-qhh4

To remediate this vulnerability, upgrade all affected Mysql dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mysql fixed: 2.14.0
npm install mysql@2.14.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mysql

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-5f7m-mmpc-qhh4, inspect your project dependencies using npm:

npm ls mysql

Analyze the terminal output to locate any version of Mysql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.14.0), your application is affected.

Note: The npm ls mysql command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-201: Insertion of Sensitive Information Into Sent Data, where the code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor. In Mysql, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Versions of `mysql` before 2.14.0 are vulnerable to remove memory exposure. Affected versions of `mysql` package allocate and send an uninitialized memory over the network when a number is provided as a password. Only `mysql` running on Node.js versions below 6.0.0 are affected due to a throw added in newer node.js versions. Proof of Concept: ``` require('mysql').createConnection({ host: 'localhost', user: 'user', password : USERPROVIDEDINPUT, // number database : 'my_db' }).connect(); ``` ## Recommendation Update to version 2.14.0 or later.

GHSA-5f7m-mmpc-qhh4 Affected Mysql Versions

1 component(s)
Fixed Versions:
2.14.0
Product / Package Ecosystem Affected Versions Fixed Version
mysql
npm
≥ 2.0.0-alpha8
< 2.14.0
2.14.0

References

Frequently Asked Questions

What is GHSA-5f7m-mmpc-qhh4?
GHSA-5f7m-mmpc-qhh4 is a security vulnerability in Mysql involving mysql Node.JS Module Vulnerable to Remote Memory Exposure under CWE-201: Insertion of Sensitive Information Into Sent Data.
Which Mysql versions are affected?
Affected versions include releases prior to 2.14.0 across affected packages: mysql.
What version fixes GHSA-5f7m-mmpc-qhh4?
Upgrading to 2.14.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mysql affected?
Yes, mysql is affected in releases prior to 2.14.0. Upgrade your dependency to 2.14.0 or later.
What CWE is associated with GHSA-5f7m-mmpc-qhh4?
GHSA-5f7m-mmpc-qhh4 is classified under CWE-201: Insertion of Sensitive Information Into Sent Data (The code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor.).
How can I check npm dependencies for GHSA-5f7m-mmpc-qhh4?
Run the dependency tree command: 'npm ls mysql'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5f7m-mmpc-qhh4",
  "modified" : "2022-08-03T20:30:06Z",
  "published" : "2019-05-23T09:27:00Z",
  "aliases" : [ ],
  "summary" : "mysql Node.JS Module Vulnerable to Remote Memory Exposure",
  "details" : "Versions of `mysql` before 2.14.0 are vulnerable to remove memory exposure.\n\nAffected versions of `mysql` package allocate and send an uninitialized memory over the network when a number is provided as a password.\n\nOnly `mysql` running on Node.js versions below 6.0.0 are affected due to a throw added in newer node.js versions.\n\nProof of Concept:\n\n```\nrequire('mysql').createConnection({\n  host: 'localhost',\n  user: 'user',\n  password : USERPROVIDEDINPUT,  // number\n  database : 'my_db'\n}).connect();\n```\n\n\n\n## Recommendation\n\nUpdate to version 2.14.0 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mysql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0-alpha8"
      }, {
        "fixed" : "2.14.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mysqljs/mysql/commit/192fe45593ba5768534afb6f2154432ca67a5002"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mysqljs/mysql/commit/310c6a7d1b2e14b63b572dbfbfa10128f20c6d52"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mysqljs/mysql"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/602"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-201" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-05-23T07:40:10Z",
    "nvd_published_at" : null
  }
}