Code injection in mysql2
Priority HIGH 82CWE-94Published · Updated
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-94.
Summary
Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.
Why it matters now
Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.01034 64th percentileScored 2026-11-07
Fix Fixed mysql2: 3.9.7mysql2 (npm): 3.9.7
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | mysql2 | before 3.9.7 | 3.9.7 | Patch available | CNA |
| — | mysql2 (npm) | before 3.9.7 | 3.9.7 | Patch available | GHSA-4rch-2fh8-94vw |
- mysql2 Vendor— Affected before 3.9.7 Fixed in 3.9.7 Patch available CNA
- mysql2 (npm) Vendor— Affected before 3.9.7 Fixed in 3.9.7 Patch available GHSA-4rch-2fh8-94vw
CPE names CISA-ADP · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:mysql2:mysql2:-:*:*:*:*:*:*:* | not specified by CISA-ADP | — | — |
- cpe:2.3:a:mysql2:mysql2:-:*:*:*:*:*:*:* Versions not specified by CISA-ADP — ·—
Remediation
- Fix · CNA mysql2 Fixed in 3.9.7
- Fix · GHSA-4rch-2fh8-94vw mysql2 (npm) Fixed in 3.9.7 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
Not affected: 1 product
- Red Hat Developer Hub 1
Timeline
- 2026-10-02 Threatist record created from CVE-2024-21511
- 2026-10-03 Alias added: GHSA-4rch-2fh8-94vw
- 2026-10-27 Affected versions changed · Red Hat
References
Sources
- CVE-2024-21511 · CVE Program
- CVE-2024-21511 · NVD
- FIRST EPSS
- GHSA-4rch-2fh8-94vw · GitHub Advisory Database · CC BY 4.0
- CVE-2024-21511 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences