Packages / mysql2 / Security

CriticalVulnerabilityGHSA-4rch-2fh8-94vwCVE-2024-21511Published 23 Apr 2024

MySQL2 for Node Arbitrary Code Injection

Affected releases · mysql2

  • 3.x3.0.0 – 3.9.6Fixed in 3.9.7
  • 2.x and older0.0.1 – 2.3.3No fix, no longer updated

On 3.x, the newest line:

npm install mysql2@3.9.7
3.x
  1. Affected

    3.0.0 – 3.9.6

    41 releases

  2. Fixed

    3.9.7 – 3.24.6

    62 releases, latest

2.x
  1. Affected

    2.0.0 – 2.3.3

    14 releases

1.x
  1. Affected

    1.0.0 – 1.7.0

    27 releases

0.x
  1. Affected

    0.0.1 – 0.15.8

    74 releases

218 stable releases of mysql2, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for mysql2. It is read in your browser and sent nowhere.

What happens

Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.