Skip to content
Fencer Intel
medium 6.5

CVE-2024-21507 json

mysql2 cache poisoning vulnerability

published 2y ago modified 2mo ago also GHSA-mqr2-w7wj-jjgr , EUVD-2024-1251

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

Summary

Versions of the package mysql2 before 3.9.3 are vulnerable to Improper Input Validation through the keyFromFields function, resulting in cache poisoning. An attacker can inject a colon (:) character within a value of the attacker-crafted key.

Patch / fix

  • npm mysql2 3.9.3
  • n/a mysql2 3.9.3
  • mysqljs mysql2 3.9.3

Is CVE-2024-21507 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-21507 updated cvss 6.5

mysql2: Improper Input Validation

  • 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.74% chance of exploitation in the next 30 days, higher than 55% of all scored CVEs (FIRST EPSS, 2026-11-11).

Exploits and checks

  • github.com https://github.com/sidorares/node-mysql2/pull/2424 referenced PoC, tagged "exploit" by a source, unverified
  • security.snyk.io https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6591300 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:L/I:N/A:L/E:P
CNA 3.1 6.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
NVD 3.1 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub 3.1 6.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L

Affected packages

ecosystem package affected fixed in
npm mysql2
<3.9.3
3.9.3

Affected products

  • n/a mysql2
  • mysqljs mysql2

Classification

Weakness
  • CWE-20 Improper Input Validation

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.