CVE-2024-21509
mysql2 vulnerable to Prototype Poisoning
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
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
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
6.5
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
- Record
CVE-2024-21509- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L/E:P - Weakness
- CWE-1321, CWE-1321
- Updated
- 2026-11-02
EUVDEUVD-2024-1089
6.5
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
- Record
EUVD-2024-1089- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L/E:P - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-49j4-86m8-q2jw
6.9
mysql2 vulnerable to Prototype Poisoning
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
- Record
GHSA-49j4-86m8-q2jw- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-1321
- Updated
- 2026-11-02
NVD
6.5
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
- Record
CVE-2024-21509- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSV
6.5
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
- Record
CVE-2024-21509- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L/E:P - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSVGHSA-49j4-86m8-q2jw
6.9
mysql2 vulnerable to Prototype Poisoning
Versions of the package mysql2 before 3.9.4 are vulnerable to Prototype Poisoning due to insecure results object creation and improper user input sanitization passed through parserFn in text_parser.js and binary_parser.js.
- Record
GHSA-49j4-86m8-q2jw- CVSS 4.0
- 6.9 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSVCLSA-2026-1786373168 No score
TuxCare security update for mysql2 (1 CVE)
TuxCare rebuilt mysql2 to address 1 CVE. Fixed in 2.3.3-tuxcare.5.
- Record
CLSA-2026-1786373168- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2024-21509 No score
CVE-2024-21509 in @rootio/mysql2 - Patched by Root
Root has patched CVE-2024-21509 in the @rootio/mysql2 package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2024-21509- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
mysql2npm |
before 3.9.4 | 3.9.4 |
mysql2TuxCare:npm |
2.3.3-tuxcare.0 up to 2.3.3-tuxcare.5, plus listed versions 2.3.32.3.3-tuxcare.12.3.3-tuxcare.22.3.3-tuxcare.32.3.3-tuxcare.4 |
2.3.3-tuxcare.5 |
@rootio/mysql2Root:npm |
before 3.9.2-root.io.2 | 3.9.2-root.io.2 |
mysql2Root:npm |
before 3.9.2-aikido.2 | 3.9.2-aikido.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| 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-21509 is a medium vulnerability (CVSS 6.5) in Mysqljs Mysql2, published April 10, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.95%, the 61st percentile. Fixed in mysql2 3.9.4.
References
security.snyk.io/vuln/SNYK-JS-MYSQL2-6591084
blog.slonser.info/posts/mysql2-attacker-configuration
github.com/sidorares/node-mysql2/blob/fd3d117da82cc5c5fa5a3701d7b33ca77691bc61/lib/parsers/text_parser.js%23L134
github.com/sidorares/node-mysql2/commit/4a964a3910a4b8de008696c554ab1b492e9b4691
github.com/sidorares/node-mysql2/pull/2574
github.com/sidorares/node-mysql2/releases/tag/v3.9.4