Skip to content
Fencer Intel
medium 6.5

CVE-2024-21509 json

mysql2 vulnerable to Prototype Poisoning

published 2y ago modified 2mo ago also GHSA-49j4-86m8-q2jw , EUVD-2024-1089

cvss
6.5
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.0%
EPSS 1.0% chance of exploitation in 30 days, percentile 61%
public exploits
0
none known

Summary

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.

Patch / fix

  • npm mysql2 3.9.4
  • n/a mysql2 3.9.4
  • mysqljs mysql2 3.9.4

Is CVE-2024-21509 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

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-21509 updated cvss 6.5

mysql2: Prototype Poisoning

  • Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9, rhdh-operator-container
    not 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
Proof of concept is public
Automatable
yes
Technical impact
partial
Assessed
2y ago

Exploit prediction

0.96% chance of exploitation in the next 30 days, higher than 61% of all scored CVEs (FIRST EPSS, 2026-11-11).

Exploits and checks

  • github.com https://github.com/sidorares/node-mysql2/pull/2574 referenced PoC, tagged "exploit" by a source, unverified
  • security.snyk.io https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6591084 referenced PoC, tagged "exploit" by a source, unverified
  • blog.slonser.info https://blog.slonser.info/posts/mysql2-attacker-configuration/ referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 6.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L/E:P
CNA 3.1 6.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
GitHub 3.1 6.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L

Affected packages

ecosystem package affected fixed in
npm mysql2
<3.9.4
3.9.4

Affected products

  • n/a mysql2
  • mysqljs mysql2

Classification

Weakness
  • CWE-1321 Improperly Controlled Modification of Object Prototype Attributes

References

Sources

Fencer Intel 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.