<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Mysql2 (&lt; 3.22.0) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/mysql2--3.22.0/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 01 Sep 2026 18:00:50 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/mysql2--3.22.0/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>MySQL2 Auth Plugin Downgrade Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-09-mysql2-cleartext-auth/</link><pubDate>Tue, 01 Sep 2026 18:00:50 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-09-mysql2-cleartext-auth/</guid><description>The mysql2 Node.js database driver is vulnerable to credential theft because it does not enforce TLS before executing a requested authentication switch to the mysql_clear_password plugin.</description><content:encoded><![CDATA[<p>The mysql2 package for Node.js is susceptible to credential interception due to insecure implementation of the mysql_clear_password authentication plugin. When a client connects to a server, the authentication process is managed by a list of standard plugins. An attacker operating a rogue MySQL server or performing a man-in-the-middle (MITM) attack can issue an AuthSwitchRequest (0xFE) to downgrade the authentication method to mysql_clear_password. Unlike other plugins, such as caching_sha2_password, the mysql2 driver fails to verify if a secure TLS connection is established before transmitting the password in plaintext. This flaw affects all versions of mysql2 prior to 3.22.0. With approximately 9 million weekly downloads, this vulnerability poses a significant risk to applications in environments where network traffic is not fully encrypted, particularly those traversing untrusted or internal network segments.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker establishes a rogue MySQL server or performs a MITM position between the application and the legitimate database.</li>
<li>The mysql2 client initiates a connection to the database.</li>
<li>The rogue server responds with an initial handshake advertising support for caching_sha2_password.</li>
<li>The client sends a hashed authentication response as expected by the protocol.</li>
<li>The rogue server ignores the response and issues an AuthSwitchRequest (0xFE) command.</li>
<li>The AuthSwitchRequest specifically requests the mysql_clear_password authentication plugin.</li>
<li>The mysql2 driver, failing to check for an active SSL/TLS layer, invokes the mysql_clear_password plugin.</li>
<li>The driver transmits the plaintext database password to the rogue server, where the attacker captures it.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability results in the exposure of database credentials in plaintext. This impacts any application using mysql2 (&lt; 3.22.0) that has not explicitly enforced TLS connections for all database communications. Given the library's high volume of weekly downloads (9 million), this poses a systemic risk to enterprise applications, particularly in cloud-native environments where network paths between services may be intercepted or spoofed.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the mysql2 package to version 3.22.0 or later immediately to include the mandatory TLS check for authentication plugins.</li>
<li>Enforce SSL/TLS connections for all database configurations within the application code to prevent unauthorized downgrades.</li>
<li>Audit network egress traffic from application servers to identify unexpected connections to database ports (default 3306) targeting unauthorized infrastructure.</li>
<li>Implement network-level segmentation and mutual TLS (mTLS) for database communications to mitigate the impact of rogue or compromised database nodes.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>credential-access</category><category>vulnerability</category><category>nodejs</category></item></channel></rss>