CVE-2024-21507: mysql2 cache poisoning vulnerability
Versions of the package mysql2 before 3.9.3 are vulnerable to Improper Input Validation through the keyFromFields function, resulting in cache poisoning. An attacker can inject a colon : character within a value of the attacker-crafted key.
Published Apr 10, 2024 · Updated Aug 2, 2024
Affected packages
mysql2
- Ecosystem
- npm
- Affected
- < 3.9.3
- Fixed in
- 3.9.3
- Check
npm ls mysql2
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Versions of the package mysql2 before 3.9.3 are vulnerable to Improper Input Validation through the keyFromFields function, resulting in cache poisoning. An attacker can inject a colon : character within a value of the attacker-crafted key.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-21507
- https://github.com/sidorares/node-mysql2/pull/2424
- https://github.com/sidorares/node-mysql2/commit/0d54b0ca6498c823098426038162ef10df02c818
- https://blog.slonser.info/posts/mysql2-attacker-configuration
- https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6591300
- https://github.com/advisories/GHSA-mqr2-w7wj-jjgr
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-21512
mysql2 vulnerable to Prototype Pollution
high8.2May 30, 2024CVE-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-21509
mysql2 vulnerable to Prototype Poisoning
medium6.5Apr 10, 2024
