CriticalGHSA-4rch-2fh8-94vwCVE-2024-21511
MySQL2 for Node Arbitrary Code Injection
Published 23 Apr 2024 · Updated 10 Sept 2026
Affected package
mysql2npm
- Affected
- <3.9.7
- Fixed in
- 3.9.7
Update to the fixed version for your release line, for example:
npm install mysql2@3.9.7Details
Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.
Is GHSA-4rch-2fh8-94vw 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-21511
- Linkgithub.com/sidorares/node-mysql2/pull/2608
- Linkgithub.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713
- Packagegithub.com/sidorares/node-mysql2
- Linkgithub.com/sidorares/node-mysql2/releases/tag/v3.9.7
- Linksecurity.snyk.io/vuln/SNYK-JS-MYSQL2-6670046
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.