CVE-2024-21512: mysql2 vulnerable to Prototype Pollution
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
Published May 30, 2024 · Updated Jun 6, 2024
Affected packages
mysql2
- Ecosystem
- npm
- Affected
- < 3.9.8
- Fixed in
- 3.9.8
- Check
npm ls mysql2
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-21512
- https://github.com/sidorares/node-mysql2/pull/2702
- https://github.com/sidorares/node-mysql2/commit/efe3db527a2c94a63c2d14045baba8dfefe922bc
- https://gist.github.com/domdomi3/e9f0f9b9b1ed6bfbbc0bea87c5ca1e4a
- https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6861580
- https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-7176010
- https://github.com/advisories/GHSA-pmh2-wpjm-fj45
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesGHSA-3f6p-5ww8-9rcr
MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials
high8.2Sep 1, 2026GHSA-rgwj-5xj2-c3m3
MySQL2: Unbounded zlib inflate in compressed MySQL protocol handler allows decompression-bomb DoS
medium5.9Aug 31, 2026CVE-2024-21511
MySQL2 for Node Arbitrary Code Injection
critical9.8Apr 23, 2024CVE-2024-21508
mysql2 Remote Code Execution (RCE) via the readCodeFor function
critical9.8Apr 11, 2024CVE-2024-21507
mysql2 cache poisoning vulnerability
medium6.5Apr 10, 2024CVE-2024-21509
mysql2 vulnerable to Prototype Poisoning
medium6.5Apr 10, 2024
