Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. mysql2
  4. ›
  5. CVE-2024-21508

CVE-2024-21508: mysql2 Remote Code Execution (RCE) via the readCodeFor function

April 11, 2024 (updated April 12, 2024)

Versions of the package mysql2 before 3.9.4 are vulnerable to Remote Code Execution (RCE) via the readCodeFor function due to improper validation of the supportBigNumbers and bigNumberStrings values.

References

  • blog.slonser.info/posts/mysql2-attacker-configuration
  • github.com/advisories/GHSA-fpw7-j2hg-69v5
  • github.com/sidorares/node-mysql2
  • github.com/sidorares/node-mysql2/blob/1609b5393516d72a4ae47196837317fbe75e0c13/lib/parsers/text_parser.js%23L14C10-L14C21
  • github.com/sidorares/node-mysql2/commit/74abf9ef94d76114d9a09415e28b496522a94805
  • github.com/sidorares/node-mysql2/pull/2572
  • github.com/sidorares/node-mysql2/releases/tag/v3.9.4
  • nvd.nist.gov/vuln/detail/CVE-2024-21508
  • security.snyk.io/vuln/SNYK-JS-MYSQL2-6591085

Code Behaviors & Features

Detect and mitigate CVE-2024-21508 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.9.4

Fixed versions

  • 3.9.4

Solution

Upgrade to version 3.9.4 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

npm/mysql2/CVE-2024-21508.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:49 +0000.