Skip to content

Commit 095729d

Browse files
committed
bug #4611 [security] DOS attack with long passwords
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
1 parent 13a288d commit 095729d

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

Diff for: ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
phpMyAdmin - ChangeLog
22
======================
33

4+
4.0.10.7 (not yet released)
5+
- bug #4611 [security] DOS attack with long passwords
6+
47
4.0.10.6 (2014-11-20)
58
- bug #4578 [security] XSS vulnerability in table print view
69
- bug #4579 [security] XSS vulnerability in zoom search page

Diff for: libraries/common.inc.php

+5
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,9 @@
866866
. ' ' . $cfg['Server']['auth_type']
867867
);
868868
}
869+
if (isset($_REQUEST['pma_password'])) {
870+
$_REQUEST['pma_password'] = substr($_REQUEST['pma_password'], 0, 256);
871+
}
869872
include_once './libraries/plugins/auth/' . $auth_class . '.class.php';
870873
// todo: add plugin manager
871874
$plugin_manager = null;
@@ -974,6 +977,8 @@
974977
$controllink = $userlink;
975978
}
976979

980+
$auth_plugin->storeUserCredentials();
981+
977982
/* Log success */
978983
PMA_log_user($cfg['Server']['user']);
979984

Diff for: libraries/plugins/AuthenticationPlugin.class.php

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ abstract public function authCheck();
4141
*/
4242
abstract public function authSetUser();
4343

44+
/**
45+
* Stores user credentials after successful login.
46+
*
47+
* @return void
48+
*/
49+
public function storeUserCredentials()
50+
{
51+
}
52+
4453
/**
4554
* User is not allowed to login to MySQL -> authentication failed
4655
*

Diff for: libraries/plugins/auth/AuthenticationCookie.class.php

+10
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,16 @@ public function authSetUser()
475475
unset($_SERVER['PHP_AUTH_PW']);
476476

477477
$_SESSION['last_access_time'] = time();
478+
}
479+
480+
/**
481+
* Stores user credentials after successful login.
482+
*
483+
* @return void
484+
*/
485+
public function storeUserCredentials()
486+
{
487+
global $cfg;
478488

479489
// Name and password cookies need to be refreshed each time
480490
// Duration = one month for username

0 commit comments

Comments
 (0)