mysql2

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

3.26.1Latest, 3 Dec 2026
107MDownloads, last month
0Advisories on the latest
7Advisories, all versions
MITLicence
4.4KStars
5.9/10OpenSSF Scorecard

Known advisories

Severity Advisory Fix Published
High MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials GHSA-3f6p-5ww8-9rcr Fixed in 3.22.0 1 Sep 2026
Moderate MySQL2: Unbounded zlib inflate in compressed MySQL protocol handler allows decompression-bomb DoS GHSA-rgwj-5xj2-c3m3 Fixed in 3.23.1 31 Aug 2026
High mysql2 vulnerable to Prototype Pollution CVE-2024-21512 Fixed in 3.9.8 30 May 2024
Critical MySQL2 for Node Arbitrary Code Injection CVE-2024-21511 Fixed in 3.9.7 23 Apr 2024
Critical mysql2 Remote Code Execution (RCE) via the readCodeFor function CVE-2024-21508 Fixed in 3.9.4 11 Apr 2024
Moderate mysql2 vulnerable to Prototype Poisoning CVE-2024-21509 Fixed in 3.9.4 10 Apr 2024
Moderate mysql2 cache poisoning vulnerability CVE-2024-21507 Fixed in 3.9.3 10 Apr 2024

In the news

On Hacker News

Sources: npm, deps.dev (CC BY 4.0), OSV. Last checked 4 Dec 2026.