# CVE-2024-21507: mysql2 cache poisoning vulnerability

- Severity: Medium 6.5 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/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.74%, higher than 55% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 3 links below, marked "exploit"
- Published: 2024-04-10T05:00:01.727Z
- Modified: 2026-09-10T03:50:12.775Z
- Also known as: GHSA-mqr2-w7wj-jjgr
- Weaknesses: CWE-20
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: snyk

## Description

Versions of the package mysql2 before 3.9.3 are vulnerable to Improper Input Validation through the keyFromFields function, resulting in cache poisoning. An attacker can inject a colon (:) character within a value of the attacker-crafted key.

(As written by CVE List.)

## Affected

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

## Every score

- snyk: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/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:L/I:N/A:L`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`

## References

- <https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6591300> (exploit, third-party-advisory, web)
- <https://blog.slonser.info/posts/mysql2-attacker-configuration/> (exploit, permissions-required)
- <https://github.com/sidorares/node-mysql2/pull/2424> (exploit, issue-tracking, web)
- <https://github.com/sidorares/node-mysql2/commit/0d54b0ca6498c823098426038162ef10df02c818> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21507> (advisory)
- <https://blog.slonser.info/posts/mysql2-attacker-configuration> (web)
- <https://github.com/sidorares/node-mysql2> (package)

## Sources

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

---

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