Skip to content

Commit

Permalink
bug #4611 [security] DOS attack with long passwords
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
  • Loading branch information
madhuracj committed Dec 2, 2014
1 parent 9b2479b commit 1ac863c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog

4.2.13.1 (not yet released)
- bug #4612 [security] XSS vulnerability in redirection mechanism
- bug #4611 [security] DOS attack with long passwords

4.2.13.0 (2014-11-30)
- bug #4604 Query history not being deleted
Expand Down
5 changes: 5 additions & 0 deletions libraries/common.inc.php
Expand Up @@ -859,6 +859,9 @@
. ' ' . $cfg['Server']['auth_type']
);
}
if (isset($_REQUEST['pma_password'])) {
$_REQUEST['pma_password'] = substr($_REQUEST['pma_password'], 0, 256);
}
include_once './libraries/plugins/auth/' . $auth_class . '.class.php';
// todo: add plugin manager
$plugin_manager = null;
Expand Down Expand Up @@ -988,6 +991,8 @@
$controllink = $userlink;
}

$auth_plugin->storeUserCredentials();

/* Log success */
PMA_logUser($cfg['Server']['user']);

Expand Down
9 changes: 9 additions & 0 deletions libraries/plugins/AuthenticationPlugin.class.php
Expand Up @@ -41,6 +41,15 @@ abstract public function authCheck();
*/
abstract public function authSetUser();

/**
* Stores user credentials after successful login.
*
* @return void
*/
public function storeUserCredentials()
{
}

/**
* User is not allowed to login to MySQL -> authentication failed
*
Expand Down
10 changes: 10 additions & 0 deletions libraries/plugins/auth/AuthenticationCookie.class.php
Expand Up @@ -557,6 +557,16 @@ public function authSetUser()
unset($_SERVER['PHP_AUTH_PW']);

$_SESSION['last_access_time'] = time();
}

/**
* Stores user credentials after successful login.
*
* @return void
*/
public function storeUserCredentials()
{
global $cfg;

$this->createBlowfishIV();

Expand Down

0 comments on commit 1ac863c

Please sign in to comment.