Intel

AIKIDO-2026-765062

mysql2 is vulnerable to Insufficiently Protected Credentials

GHSA-3f6p-5ww8-9rcrPublished Jul 23, 2026
July 23, 2026

75

CVSS Score

High

Insufficiently Protected Credentials

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.

How do I fix this?

Upgrade the mysql2 library to the patch version.

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.

Package

Versions

3.0.0 - 3.21.1

Fixed in 3.22.0

Background info

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

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea