# CVE-2024-21508: mysql2 Remote Code Execution (RCE) via the readCodeFor function

- 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): 2.55%, higher than 85% of CVEs (2026-12-01)
- Published: 2024-04-11T05:00:00.748Z
- Modified: 2026-09-10T03:50:11.212Z
- Also known as: GHSA-fpw7-j2hg-69v5
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: snyk

## Description

Versions of the package mysql2 before 3.9.4 are vulnerable to Remote Code Execution (RCE) via the readCodeFor function due to improper validation of the supportBigNumbers and bigNumberStrings values.

(As written by CVE List.)

## Affected

- mysql2: before 3.9.4
- mysql2 mysql2: before 3.9.4
- mysql2 (npm): before 3.9.4

## 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-6591085> (web)
- <https://blog.slonser.info/posts/mysql2-attacker-configuration/>
- <https://github.com/sidorares/node-mysql2/blob/1609b5393516d72a4ae47196837317fbe75e0c13/lib/parsers/text_parser.js%23L14C10-L14C21> (web)
- <https://github.com/sidorares/node-mysql2/pull/2572> (web)
- <https://github.com/sidorares/node-mysql2/commit/74abf9ef94d76114d9a09415e28b496522a94805> (web)
- <https://github.com/sidorares/node-mysql2/releases/tag/v3.9.4> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21508> (advisory)
- <https://blog.slonser.info/posts/mysql2-attacker-configuration> (web)
- <https://github.com/sidorares/node-mysql2> (package)

## Sources

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

---

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