# CVE-2024-21512: mysql2 vulnerable to Prototype Pollution

- Severity: High 8.2 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/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): 3.14%, higher than 88% of CVEs (2026-12-01)
- Published: 2024-05-29T05:00:01.515Z
- Modified: 2026-09-10T03:49:18.750Z
- Also known as: GHSA-pmh2-wpjm-fj45
- 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.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.

(As written by CVE List.)

## Affected

- mysql2: before 3.9.8
- org.webjars.npm:mysql2: before *
- mysql2 mysql2: before 3.9.8
- mysql2 (npm): before 3.9.8

## Every score

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

## References

- <https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6861580> (web)
- <https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-7176010> (web)
- <https://gist.github.com/domdomi3/e9f0f9b9b1ed6bfbbc0bea87c5ca1e4a> (web)
- <https://github.com/sidorares/node-mysql2/pull/2702> (web)
- <https://github.com/sidorares/node-mysql2/commit/efe3db527a2c94a63c2d14045baba8dfefe922bc> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21512> (advisory)
- <https://github.com/sidorares/node-mysql2> (package)

## Sources

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

---

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