CVE-2024-21512
mysql2 vulnerable to Prototype Pollution
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
8.2
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
- Record
CVE-2024-21512- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L/E:P - Weakness
- CWE-1321
- Updated
- 2026-11-02
EUVDEUVD-2024-1718
8.2
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
- Record
EUVD-2024-1718- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L/E:P - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-pmh2-wpjm-fj45
8.2
mysql2 vulnerable to Prototype Pollution
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
- Record
GHSA-pmh2-wpjm-fj45- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L - Weakness
- CWE-1321
- Updated
- 2026-11-02
NVD
8.2
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
- Record
CVE-2024-21512- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSV
8.2
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
- Record
CVE-2024-21512- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L/E:P - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSVGHSA-pmh2-wpjm-fj45
8.2
mysql2 vulnerable to Prototype Pollution
Versions of the package mysql2 before 3.9.8 are vulnerable to Prototype Pollution due to improper user input sanitization passed to fields and tables when using nestTables.
- Record
GHSA-pmh2-wpjm-fj45- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSVCLSA-2026-1773274566 No score
TuxCare security update for mysql2 (3 CVEs)
TuxCare rebuilt mysql2 to address 3 CVEs. Fixed in 2.3.3-tuxcare.2.
- Record
CLSA-2026-1773274566- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2024-21512 No score
CVE-2024-21512 in mysql2 - Patched by Root
Root has patched CVE-2024-21512 in the mysql2 package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2024-21512- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
mysql2npm |
before 3.9.8 | 3.9.8 |
mysql2TuxCare:npm From an advisory covering 3 CVEs |
2.3.3-tuxcare.0 up to 2.3.3-tuxcare.2, plus listed versions 2.3.32.3.3-tuxcare.1 |
2.3.3-tuxcare.2 |
mysql2Root:npm |
before 3.9.7-aikido.2 | 3.9.7-aikido.22.3.3-aikido.33.7.1-aikido.43.9.2-aikido.13.9.2-aikido.22.3.3-aikido.43.7.1-aikido.13.7.1-aikido.23.7.1-aikido.33.9.8-aikido.1 |
@rootio/mysql2Root:npm |
before 2.3.3-root.io.2 | 2.3.3-root.io.23.9.7-root.io.13.9.7-root.io.22.3.3-root.io.33.7.1-root.io.43.9.2-root.io.13.9.2-root.io.22.3.3-root.io.43.7.1-root.io.13.7.1-root.io.23.7.1-root.io.33.9.8-root.io.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-21512 is a high vulnerability (CVSS 8.2) in Mysql2, published May 29, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.14%, the 87th percentile. Fixed in mysql2 3.9.8.
References
security.snyk.io/vuln/SNYK-JS-MYSQL2-6861580
security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-7176010
gist.github.com/domdomi3/e9f0f9b9b1ed6bfbbc0bea87c5ca1e4a
github.com/sidorares/node-mysql2/pull/2702
github.com/sidorares/node-mysql2/commit/efe3db527a2c94a63c2d14045baba8dfefe922bc
nvd.nist.gov/vuln/detail/CVE-2024-21512
github.com/advisories/GHSA-pmh2-wpjm-fj45
github.com/CVEProject/cvelistV5/tree/main/cves/2024/21xxx/CVE-2024-21512.json
github.com/sidorares/node-mysql2