Résumé
MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials
Détails de l’avis
Summary
A rogue MySQL server (or MITM) can force mysql2 to send credentials in plaintext by requesting an auth switch to mysql_clear_password. The driver complies without verifying that TLS is active.
Details
mysql_clear_password is registered as a default standard plugin in lib/commands/auth_switch.js (line 21). When a server sends an AuthSwitchRequest (0xFE) requesting mysql_clear_password, the driver executes it without checking for TLS. The plugin (lib/auth_plugins/mysql_clear_password.js) returns Buffer.from(password + '\0').
Note: caching_sha2_password plugin DOES check for SSL before sending cleartext (line 77). But mysql_clear_password has no such guard.
Attack Scenario
- Attacker operates rogue MySQL server or performs MITM
- Server advertises
caching_sha2_passwordin handshake - Client sends hashed auth response
- Server replies with AuthSwitchRequest to
mysql_clear_password - Client sends password in plaintext
- Attacker captures plaintext password
PoC
Rogue MySQL server (Node.js, ~80 lines) that captures plaintext passwords from mysql2 clients. Tested against mysql2 3.20.0. Full PoC available on request.
Suggested Fix
Remove mysql_clear_password from standardAuthPlugins, or add a guard requiring TLS/unix socket before allowing cleartext auth.
Impact
- mysql2: 9M weekly downloads
- Any application connecting without TLS is vulnerable to credential theft
- Cloud environments with untrusted network paths are especially at risk
Références
- https://github.com/advisories/GHSA-3f6p-5ww8-9rcr
- https://github.com/sidorares/node-mysql2/security/advisories/GHSA-3f6p-5ww8-9rcr
- https://github.com/sidorares/node-mysql2/issues/1617
- https://github.com/sidorares/node-mysql2/pull/4236
- https://github.com/sidorares/node-mysql2/commit/884bec56288d827939d0dd3f1f4ae476fbc8dbeb
- https://github.com/sidorares/node-mysql2/releases/tag/v3.22.0
Vulnérabilités liées
Tout Supply chain →- HIGHCVE-2026-72793
SiYuan: Non-administrator responses from /api/system/getConf omit three secrets that the configuration-export path explicitly strips, disclosing the session-cookie signing key and the OS username to anonymous readers
- HIGHCVE-2026-72794
SiYuan: The session-cookie signing key (Conf.CookieKey) is returned to anonymous readers by /api/system/getConf
- HIGHCVE-2026-72801
SiYuan: Encrypted-notebook key-derivation material and wrapped notebook keys disclosed to anonymous readers, enabling offline master-password cracking
- HIGHGHSA-vx52-2968-3vc6
pnpm: Environment secrets exfiltrated via env-placeholder expansion in proxy settings read from an untrusted pnpm-workspace.yaml
- MEDIUMCVE-2026-55860
org.mariadb:r2dbc-mariadb vulnerable to cleartext password disclosure to a man-in-the-middle server (clear-text auth plugins not gated on a secure transport)
- MEDIUMCVE-2026-55857
org.mariadb.jdbc:mariadb-java-client has Cleartext Transmission of Sensitive Information and Insufficiently Protected Credentials