Intel

AIKIDO-2026-448685

mysql2 is vulnerable to Denial of Service (DoS)

Denial of Service (DoS)GHSA-rgwj-5xj2-c3m3 Published Yesterday

59

Medium Risk

This Affects:

JSmysql2
0.0.1 - 3.23.0
Fixed in 3.23.1
Are you affected? Scan for Free

TL;DR

handleCompressedPacket inflates server-supplied MySQL compressed frames with zlib.inflate and no output size ceiling, so the declared uncompressed length is never enforced against the real inflate result. An attacker who controls compressed packet contents can expand a small payload into a much larger buffer and exhaust CPU or memory. The fix passes maxOutputLength: deflatedLength into zlib.inflate so oversized decompressed output is rejected.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and MySQL client compression is enabled (compress: true).

Background info

mysql2 is vulnerable to Denial of Service (DoS) in versions 0.0.1 - 3.23.0.

How to fix this

Upgrade the mysql2 library to the patch version.