mysql2 vulnerabilities

fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS

Registry
npm
Latest
3.24.6
License
MIT

7 known advisories

The latest version, 3.24.6, is not affected by any of them. Projects on older versions may be.

Update to the latest version:npm install mysql2@3.24.6

Security advisories for mysql2

  • 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
  • HighGHSA-pmh2-wpjm-fj4530 May 2024

    mysql2 vulnerable to Prototype Pollution

    Affected
    <3.9.8
    Fixed in
    3.9.8
  • CriticalGHSA-4rch-2fh8-94vw23 Apr 2024

    MySQL2 for Node Arbitrary Code Injection

    Affected
    <3.9.7
    Fixed in
    3.9.7
  • CriticalGHSA-fpw7-j2hg-69v511 Apr 2024

    mysql2 Remote Code Execution (RCE) via the readCodeFor function

    Affected
    <3.9.4
    Fixed in
    3.9.4
  • MediumGHSA-49j4-86m8-q2jw10 Apr 2024

    mysql2 vulnerable to Prototype Poisoning

    Affected
    <3.9.4
    Fixed in
    3.9.4
  • MediumGHSA-mqr2-w7wj-jjgr10 Apr 2024

    mysql2 cache poisoning vulnerability

    Affected
    <3.9.3
    Fixed in
    3.9.3

Which of your client projects still run an old mysql2?

NPMscan reads the package-lock.json, yarn.lock and pnpm-lock.yaml in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other npm packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the npm registry.