# mysql2 (npm)

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

- Latest: 3.26.1 (2026-12-03)
- Licence: MIT
- Downloads: 107380477 last month
- Advisories on the latest version: 0

- GHSA-3f6p-5ww8-9rcr HIGH: MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials Fixed in 3.22.0.
- GHSA-rgwj-5xj2-c3m3 MODERATE: MySQL2: Unbounded zlib inflate in compressed MySQL protocol handler allows decompression-bomb DoS Fixed in 3.23.1.
- CVE-2024-21512 HIGH: mysql2 vulnerable to Prototype Pollution Fixed in 3.9.8.
- CVE-2024-21511 CRITICAL: MySQL2 for Node Arbitrary Code Injection Fixed in 3.9.7.
- CVE-2024-21508 CRITICAL: mysql2 Remote Code Execution (RCE) via the readCodeFor function Fixed in 3.9.4.
- CVE-2024-21509 MODERATE: mysql2 vulnerable to Prototype Poisoning Fixed in 3.9.4.
- CVE-2024-21507 MODERATE: mysql2 cache poisoning vulnerability Fixed in 3.9.3.

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