question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not enable mysql_clear_password by default

See original GitHub issue

#1552 added support for the mysql_clear_password auth plugin, but made it enabled by default. Per the manual docs on it:

Sending passwords as cleartext may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include SSL (see Section 6.3, “Using Encrypted Connections”), IPsec, or a private network.

To make inadvertent use of the mysql_clear_password plugin less likely, MySQL clients must explicitly enable it.

I would propose to make it disabled by default, and only enable it implicitly if the LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN environment variable is set to 1, Y or y (per the docs), or that a library consumer can add it themselves via config.authPlugins (following #1497 being merged to make it easy to reference).

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
MasterOdincommented, Nov 15, 2022

end to end test covering happy and error path. This is probably the most complicated step. I haven’t found an easy way to configure real mysql server with mysql_clear_password auth, possible option is to have mysql2.createServer server but not sure how much work is to have that running

Yeah, neither have I, without also configuring something like ldap alongside it. I agree the best option is to use mysql2.createServer. My plan was to base a test on one of:

I think this is shouldn’t be too bad, just haven’t yet found time, hoping to at some point this week.

1reaction
rathbomacommented, Nov 10, 2022

So as @sidorares suggested higher up the thread, adding a config parameter to createConnection or createPool sounds perfect.

mysql.createPool({
  enableCleartextPlugin: true
  ...
})
// this would be amazing
Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication plugin 'mysql_clear_password' cannot be ...
Open Connect to Database window; Choose Advanced option; Tick Enable Cleartext Authentication Plugin option. enter image description here. Share.
Read more >
B.3.3.2 How to Reset the Root Password
On Windows, use the following procedure to reset the password for the MySQL 'root'@'localhost' account. To change the password for a root account...
Read more >
Security in MySQL :: 4.15 Password Management
The setting is established by the PASSWORD REQUIRE option of the CREATE USER and ALTER USER statements:
Read more >
Chapter 4 Resetting the Root Password: Windows Systems
On Windows, use the following procedure to reset the password for the MySQL 'root'@'localhost' account. To change the password for a root account...
Read more >
3.4 Securing the Initial MySQL Accounts
$> mysql -u root -p Enter password: (enter root password here) mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('new_password');. To use SET PASSWORD on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found