Increase password characters limit during login

- allow logging in with longer passwords, for example tokens generated
by AWS RDS IAM authentication

- show error message when the limit is reached instead of silently
trimming the password to avoid confusion

Signed-off-by: Kamil Hristov <kamilhristov@gmail.com>
This commit is contained in:
Kamil Hristov 2020-11-02 22:15:04 +02:00
parent f8bf16fcd8
commit 3ed01db704

View File

@ -335,8 +335,11 @@ class AuthenticationCookie extends AuthenticationPlugin
$this->user = Core::sanitizeMySQLUser($_POST['pma_username']);
$password = $_POST['pma_password'] ?? '';
if (strlen($password) > 256) {
$password = substr($password, 0, 256);
if (strlen($password) > 1000) {
$conn_error = __('Your password is too long. To prevent denial-of-service attacks, ' .
'phpMyAdmin restricts passwords to less than 1000 characters.');
return false;
}
$this->password = $password;