# CVE-2024-21509: mysql2 vulnerable to Prototype Poisoning

- Severity: Medium 6.5 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L/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): 0.95%, higher than 62% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 3 links below, marked "exploit"
- Published: 2024-04-10T05:00:00.795Z
- Modified: 2026-09-10T03:50:11.188Z
- Also known as: GHSA-49j4-86m8-q2jw
- Weaknesses: CWE-1321
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: snyk

## Description

Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.

(As written by CVE List.)

## Affected

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

## Every score

- snyk: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L/E:P`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N`

## References

- <https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6591084> (exploit, third-party-advisory, web)
- <https://blog.slonser.info/posts/mysql2-attacker-configuration/> (exploit, permissions-required)
- <https://github.com/sidorares/node-mysql2/pull/2574> (exploit, issue-tracking, web)
- <https://github.com/sidorares/node-mysql2/blob/fd3d117da82cc5c5fa5a3701d7b33ca77691bc61/lib/parsers/text_parser.js%23L134> (broken-link, web)
- <https://github.com/sidorares/node-mysql2/commit/4a964a3910a4b8de008696c554ab1b492e9b4691> (patch, web)
- <https://github.com/sidorares/node-mysql2/releases/tag/v3.9.4> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21509> (advisory)
- <https://blog.slonser.info/posts/mysql2-attacker-configuration> (web)
- <https://github.com/sidorares/node-mysql2> (package)

## Sources

- CVE List: [CVE-2024-21509](https://www.cve.org/CVERecord?id=CVE-2024-21509), CVE Terms of Use, modified 2024-08-22
- GitHub Advisory Database: [GHSA-49j4-86m8-q2jw](https://github.com/advisories/GHSA-49j4-86m8-q2jw), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-21509](https://nvd.nist.gov/vuln/detail/CVE-2024-21509), Public domain, modified 2026-06-17

---

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