MediumGHSA-mqr2-w7wj-jjgrCVE-2024-21507
mysql2 cache poisoning vulnerability
Published 10 Apr 2024 · Updated 10 Sept 2026
Affected package
mysql2npm
- Affected
- <3.9.3
- Fixed in
- 3.9.3
Update to the fixed version for your release line, for example:
npm install mysql2@3.9.3Details
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.
Is GHSA-mqr2-w7wj-jjgr in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected mysql2, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2024-21507
- Linkgithub.com/sidorares/node-mysql2/pull/2424
- Linkgithub.com/sidorares/node-mysql2/commit/0d54b0ca6498c823098426038162ef10df02c818
- Linkblog.slonser.info/posts/mysql2-attacker-configuration
- Packagegithub.com/sidorares/node-mysql2
- Linksecurity.snyk.io/vuln/SNYK-JS-MYSQL2-6591300
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.