CVE-2024-21508 json
mysql2 Remote Code Execution (RCE) via the readCodeFor function
published 2024-04-11 2 y ago modified 2026-09-10 1 mo ago also EUVD-2024-1197 , GHSA-fpw7-j2hg-69v5
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.6%
- EPSS 2.6% chance of exploitation in 30 days, percentile 85%
- public exploits
- 0
- none known
Summary
Versions of the package mysql2 before 3.9.4 are vulnerable to Remote Code Execution (RCE) via the readCodeFor function due to improper validation of the supportBigNumbers and bigNumberStrings values.
Patch / fix
- npm mysql2 3.9.4
- n/a mysql2 3.9.4
- mysql2 mysql2 3.9.4
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-21508 updated cvss 9.8
mysql2: Remote Code Execution
-
Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9, rhdh-operator-containernot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
2.55% chance of exploitation in the next 30 days, higher than 85% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | mysql2 | <3.9.4 |
3.9.4 |
Affected products
- n/a mysql2
- mysql2 mysql2
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/sidorares/node-mysql2/pull/2572
web
-
github.com
/sidorares/node-mysql2/commit/74abf9ef94d76114d9a09415e28b496522a94805
web
-
security.snyk.io
/vuln/SNYK-JS-MYSQL2-6591085
web
- blog.slonser.info /posts/mysql2-attacker-configuration/
-
github.com
/sidorares/node-mysql2/blob/1609b5393516d72a4ae47196837317fbe75e0c13/lib/parsers/text_parser.js%23L14C10-L14C2
web
-
github.com
/sidorares/node-mysql2/releases/tag/v3.9.4
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-21508
advisory
-
blog.slonser.info
/posts/mysql2-attacker-configuration
web
-
github.com
/sidorares/node-mysql2
package
Sources
- CVE List CVE-2024-21508
- GitHub Advisory GHSA-fpw7-j2hg-69v5
- NVD CVE-2024-21508
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.