CVE-2024-21511
CRITICAL 9.8CVSS 3.1MySQL2 for Node Arbitrary Code Injection
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.
- Published
- 23 Apr 2024
- Last modified
- 10 Sep 2026
- Assigned by
- report@snyk.io
- NVD status
- Deferred
- Weakness
- CWE-94
- Also known as
- GHSA-4rch-2fh8-94vw
- Sources
- NVDJSONOSV GHSA-4rch-2fh8-94vwJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | npm | mysql2 | < 3.9.7 | 3.9.7 |
References
- https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713 · WEB
- https://github.com/sidorares/node-mysql2/pull/2608 · WEB
- https://github.com/sidorares/node-mysql2/releases/tag/v3.9.7 · WEB
- https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6670046 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-21511 · ADVISORY
- https://github.com/sidorares/node-mysql2 · PACKAGE
History
- 25 Nov 2026 20:55 UTC · NVD: first stored (published 23 Apr 2024)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 23 Apr 2024)