diff --git a/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/libraries/classes/Plugins/Auth/AuthenticationCookie.php index 96e723c878..456699d171 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationCookie.php +++ b/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -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;