CVE-2024-21507 mysql2 cache poisoning vulnerability

Medium 6.5 Published Updated

An attacker can poison the cache in the mysql2 library by injecting colons into keys, potentially leading to data exposure or integrity issues.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-21507?

CVE-2024-21507 is a medium-severity vulnerability in mysql2, published on 10 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-20

Which versions are affected by CVE-2024-21507?

2 open source packages ship an affected version, including mysql2. It affects 1 product.

PackageAffectedFixed in
mysql2 npmAll versions3.9.3
mysql2 npmAll versions3.9.3

Products include Sidorares Mysql2.

How do I fix CVE-2024-21507?

Upgrade mysql2 to 3.9.3 or later.

Is CVE-2024-21507 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21507 exists.

Sources

Also known as CLSA-2026-1777336745, GHSA-mqr2-w7wj-jjgr, ROOT-APP-NPM-CVE-2024-21507.

Is CVE-2024-21507 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free