Is mysql2 3.0 vulnerable?

npm · 2 releases from 3.0.0 to 3.0.1 · latest mysql2 is 3.24.6 · checked 1 Nov 2026

Yes: 7 known advisories

Yes. mysql2 3.0.1, the last 3.0 release, is affected by 7 known security advisories (2 critical, 2 high, 3 medium), including CVE-2024-21511, CVE-2024-21508, CVE-2024-21512. Upgrade to 3.23.1 or later to fix all of them.

Upgrade with:npm install mysql2@3.23.1

Is your project affected?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Advisories affecting mysql2 3.0.1

  • HighGHSA-3f6p-5ww8-9rcr1 Sept 2026

    MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials

    Affected
    <3.22.0
    Fixed in
    3.22.0
  • MediumGHSA-rgwj-5xj2-c3m331 Aug 2026

    MySQL2: Unbounded zlib inflate in compressed MySQL protocol handler allows decompression-bomb DoS

    Affected
    <3.23.1
    Fixed in
    3.23.1
  • HighCVE-2024-21512GHSA-pmh2-wpjm-fj4530 May 2024

    mysql2 vulnerable to Prototype Pollution

    Affected
    <3.9.8
    Fixed in
    3.9.8
  • CriticalCVE-2024-21511GHSA-4rch-2fh8-94vw23 Apr 2024

    MySQL2 for Node Arbitrary Code Injection

    Affected
    <3.9.7
    Fixed in
    3.9.7
  • CriticalCVE-2024-21508GHSA-fpw7-j2hg-69v511 Apr 2024

    mysql2 Remote Code Execution (RCE) via the readCodeFor function

    Affected
    <3.9.4
    Fixed in
    3.9.4
  • MediumCVE-2024-21509GHSA-49j4-86m8-q2jw10 Apr 2024

    mysql2 vulnerable to Prototype Poisoning

    Affected
    <3.9.4
    Fixed in
    3.9.4
  • MediumCVE-2024-21507GHSA-mqr2-w7wj-jjgr10 Apr 2024

    mysql2 cache poisoning vulnerability

    Affected
    <3.9.3
    Fixed in
    3.9.3

Which of your client projects are still on mysql2 3.0?

NPMscan reads the lockfiles in every GitHub repo you pick, finds the exact mysql2 version each one installs, and checks it against these advisories. Each finding comes with the command that fixes it.

Other mysql2 versions

Advisory data from OSV.dev (opens OSV.dev in a new tab), which includes the GitHub Advisory Database. Release list from the npm registry. Refreshed daily.