# CVE-2024-21511: MySQL2 for Node Arbitrary Code Injection

- Severity: Critical 9.8 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.03%, higher than 64% of CVEs (2026-12-01)
- Published: 2024-04-23T05:00:00.602Z
- Modified: 2026-09-10T03:50:11.169Z
- Also known as: GHSA-4rch-2fh8-94vw
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: snyk

## Description

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.

(As written by CVE List.)

## Affected

- mysql2: before 3.9.7
- mysql2 mysql2: before 3.9.7
- mysql2 (npm): before 3.9.7

## Every score

- snyk: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6670046> (web)
- <https://github.com/sidorares/node-mysql2/releases/tag/v3.9.7> (web)
- <https://github.com/sidorares/node-mysql2/pull/2608> (web)
- <https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21511> (advisory)
- <https://github.com/sidorares/node-mysql2> (package)

## Sources

- CVE List: [CVE-2024-21511](https://www.cve.org/CVERecord?id=CVE-2024-21511), CVE Terms of Use, modified 2024-08-01
- GitHub Advisory Database: [GHSA-4rch-2fh8-94vw](https://github.com/advisories/GHSA-4rch-2fh8-94vw), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-21511](https://nvd.nist.gov/vuln/detail/CVE-2024-21511), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-21511 · Whole record: https://cve.day/CVE-2024-21511.json · Rebuilt by cve.day 2026-11-25T22:58:39.521Z
