CVE-2024-21511mysql2
Critical 9.8 No auth needed
Follow: this CVE · mysql2 · mysql2 We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 1.4% probability of exploitation in 30 days · percentile 73
- Auth required
- No
- Published
- Apr 23, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-94
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for mysql2.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | mysql2 |
< 3.9.7 |
3.9.7 |
npm install mysql2@3.9.7 |
Per OSV / GitHub Advisories (GHSA-4rch-2fh8-94vw). Check the version in your lockfile before upgrading.
Affected products
- mysql2 · mysql2
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official sources
References
Links published by the sources. Open them with care.