Skip to content

📦 Update dependency mysql2 to v3.22.0 [SECURITY] - #3110

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-mysql2-vulnerability
Open

📦 Update dependency mysql2 to v3.22.0 [SECURITY]#3110
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-mysql2-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
mysql2 (source) 3.11.33.22.0 age confidence

See all other Renovate PRs on the Dependency Dashboard


MySQL2: Auth Plugin Downgrade to mysql_clear_password Leaks Plaintext Credentials

GHSA-3f6p-5ww8-9rcr

More information

Details

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
  1. Attacker operates rogue MySQL server or performs MITM
  2. Server advertises caching_sha2_password in handshake
  3. Client sends hashed auth response
  4. Server replies with AuthSwitchRequest to mysql_clear_password
  5. Client sends password in plaintext
  6. 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

Severity

  • CVSS Score: 8.2 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

sidorares/node-mysql2 (mysql2)

v3.22.0

Compare Source

Features
Performance Improvements
  • defer Error object creation to error handlers in promise wrappers (#​4257) (ab131de)

v3.21.1

Compare Source

Bug Fixes

v3.21.0

Compare Source

Features
  • add support for query attributes (#​4223) (d732f78)
  • types: export ExecuteValues and QueryValues from entry point (9fafd6f)

v3.20.0

Compare Source

Features
  • add TracingChannel support for native APM instrumentation (#​4178) (c06afc2)
Bug Fixes

v3.19.1

Compare Source

Bug Fixes
  • bound null-terminated string read to packet end (fixes a potential OOB read reported by Doruk Tan Ozturk (peaktwilight)) (#​4161) (91c5229)
  • handle malformed geometry payloads (fixes a potential DoS vulnerability reported by Doruk Tan Ozturk (peaktwilight)) (#​4164) (1869215)
  • prevent query param override of URL-defined connection options (fixes a potential config injection vulnerability reported by Doruk Tan Ozturk (peaktwilight)) (#​4162) (3123b4e)
  • validate buffer bounds in geometry parser (fixes a potential DoS vulnerability reported by Doruk Tan Ozturk (peaktwilight)) (#​4159) (7c2ae00)

v3.19.0

Compare Source

Features
  • use server's preferred auth method to eliminate auth switch roundtrip (#​4140) (b57c671)
Bug Fixes

v3.18.2

Compare Source

Bug Fixes
  • types: add supportBigNumbers, bigNumberStrings, dateStrings, and timezone options to QueryOptions (#​4127) (b274e72)
  • types: extend QueryValues to callback-based methods (#​4129) (2ad5f0b)
  • types: improve ExecuteValues "nested" params (#​4133) (3f94950)
  • types: support Raw and Uint8Array params (#​4132) (bde9aec)

v3.18.1

Compare Source

Bug Fixes
  • types: ensure optional params in query and execute methods (#​4123) (3f4bbca)

v3.18.0

Compare Source

Features
  • add Symbol.dispose and Symbol.asyncDispose support for Connections, Pools, and Pool Clusters (#​4112) (1e612dc)

v3.17.5

Compare Source

Bug Fixes

v3.17.4

Compare Source

Bug Fixes

v3.17.3

Compare Source

Bug Fixes
  • fix PoolConnection.end callback and promise resolution (#​3937) (18ff2c6)

v3.17.2

Compare Source

Bug Fixes
  • distinguish delimiters in queries from SQL comments (#​4084) (454ba10)
  • pool: discard connection on error 1290 (Aurora read-only failure) (#​4075) (9188963)
  • pool: handle all read-only errors during Aurora failover (#​4082) (ce98d8e)

v3.17.1

Compare Source

Bug Fixes
  • expand object params after ON DUPLICATE KEY UPDATE preceded by SET (#​4076) (4d2b930)

v3.17.0

Compare Source

Bug Fixes
  • security: resolve a potential SQL injection bypass through objects (#​4054) (7f133cc)

v3.16.3

Compare Source

Bug Fixes
  • constants: remove unsupported CLIENT_DEPRECATE_EOF flag from constants (#​4033) (46c3f60)

v3.16.2

Compare Source

Bug Fixes
  • types: add missing ConnectionState type to Promise Connection interface (#​4034) (2927949)

v3.16.1

Compare Source

Bug Fixes
  • named-placeholders: improve handling of mixed/nested quotes in query parsing (#​4011) (3e00cd7)

v3.16.0

Compare Source

Features
  • BaseConnection: add state getter to track connection lifecycle (#​3958) (a394487)

v3.15.3

Compare Source

Bug Fixes

v3.15.2

Compare Source

Bug Fixes
  • fix sha256_password to work correctly over a TLS connection (#​3809) (fb9eae1)

v3.15.1

Compare Source

Bug Fixes

v3.15.0

Compare Source

Features

v3.14.5

Compare Source

Bug Fixes

v3.14.4

Compare Source

Bug Fixes

v3.14.3

Compare Source

Bug Fixes
  • resolve parser cache collision with dual typeCast connections (#​3644) (ce2ad75)

v3.14.2

Compare Source

Bug Fixes

v3.14.1

Compare Source

Miscellaneous Chores

v3.14.0

Compare Source

Features

v3.13.0

Compare Source

Features
Bug Fixes
  • PromisePoolCluster.of returns PromisePoolCluster instead of PoolNamespace (#​3261) (be22202)
  • query: support VECTOR packets in static parser (#​3379) (603c246)

v3.12.0

Compare Source

Features

v3.11.5

Compare Source

Bug Fixes

v3.11.4

Compare Source

Bug Fixes
  • types: correct TypeCast's Next callback to return unknown (#​3129) (401db79)

Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Never, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot enabled auto-merge (squash) September 2, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants