Bug #117669 Users can not upgrade their passwords to caching_sha2_password encryption

Submitted: 11 Mar 2025 18:32 Modified: 12 Mar 2025 6:48
Reporter: Björn Voigt (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:8.0.41 OS:Any
Assigned to: CPU Architecture:Any
Tags: password, Password hashing, password update

[11 Mar 2025 18:32] Björn Voigt
Description:
Upgraded MySQL setups often have existing users with mysql_native_password passwords.

Some users want to upgrade the password encryption. 

The documentation ("3.5 Changes in MySQL 8.0") says, that

"Existing users who wish to switch to caching_sha2_password can do so using the ALTER USER statement: 

ALTER USER user IDENTIFIED WITH caching_sha2_password BY 'password';"

This is not possible for "none-admin" users. The error message is:

ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation

How to repeat:
1) Create a user "testuser" with a mysql_native_password password
   CREATE USER testuser@'%' IDENTIFIED WITH 'mysql_native_password' BY 'password';
2) Login as user testuser
3) Try to change the password and the password encryption:
   alter user current_user() identified with caching_sha2_password by 'newpassword';

Suggested fix:
Allow users to change their password encryption.

At least changing passwords to the new default_authentication_plugin encryption should by possible without the "CREATE USER" privilege.

Two alternatives:
1) Change the password encryption automatically to the 
   'default_authentication_plugin' encryption with
   alter user current_user() identified by 'newpassword';
2) Add an additional option or privilege
[12 Mar 2025 6:48] MySQL Verification Team
Hello Björn,

Thank you for the report and feedback.

regards,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.