CVE-2024-21507: mysql2 cache poisoning vulnerability
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.43242%
CWE
Published
4/10/2024
Updated
8/2/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mysql2 | npm | < 3.9.3 | 3.9.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the original implementation of keyFromFields which used manual string concatenation with '/' and ':' separators to create cache keys. This allowed injection of colon characters in field properties (like name, schema, or table) to create ambiguous cache keys. The GitHub patch replaced this with JSON.stringify serialization to safely structure the key. Multiple sources (CVE description, commit message, and security advisories) explicitly reference keyFromFields as the vulnerable component. The attack vector demonstrated in the blog post and Snyk's PoC both rely on manipulating field metadata to exploit this key generation weakness.