CVE-2024-21511: MySQL2 for Node Arbitrary Code Injection
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.27329%
CWE
Published
4/23/2024
Updated
4/23/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mysql2 | npm | < 3.9.7 | 3.9.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper sanitization when constructing date/time parsing code strings. Both parser implementations directly embedded user-controlled 'timezone' parameters into generated JavaScript code using string interpolation without proper escaping. This allowed attackers to inject Node.js code through specially crafted timezone values. The fix introduced helpers.srcEscape() to sanitize these inputs, and the added test cases specifically target timezone parameter injection scenarios in both binary and text parsers.