Intel

AIKIDO-2026-765062

mysql2 is vulnerable to Insufficiently Protected Credentials

Insufficiently Protected CredentialsGHSA-3f6p-5ww8-9rcr Published 4 days ago

75

High Risk

This Affects:

JSmysql2
3.0.0 - 3.21.1
Fixed in 3.22.0
Are you affected? Scan for Free

TL;DR

The mysql2 driver registers mysql_clear_password as a default authentication plugin that returns the account password as a plaintext buffer. A rogue or man-in-the-middle MySQL server can send an authentication-switch request selecting mysql_clear_password, and the driver complies without requiring that the connection be encrypted. On unencrypted connections the client transmits the password in cleartext, letting the malicious endpoint capture credentials. The fix disables the cleartext plugin by default and requires explicit opt-in through the enableCleartextPlugin option or a custom auth plugin.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and connect without TLS to an untrusted or user-controlled MySQL server.

Background info

mysql2 is vulnerable to Insufficiently Protected Credentials in versions 3.0.0 - 3.21.1.

How to fix this

Upgrade the mysql2 library to the patch version.