diff --git a/ChangeLog b/ChangeLog index 083095388a..c331f28e9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -75,6 +75,10 @@ phpMyAdmin - ChangeLog + rfe #1537 PHP OpenSSL support for cookie encryption/decryption - bug #4227 Token mismatch when using HTTP AUTH and the SESSION expires +4.2.13.1 (2014-12-03) +- 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 - bug #4057 db/table query string parameters no longer work diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 15b028e0e4..9763ee07fc 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -860,6 +860,9 @@ if (! defined('PMA_MINIMUM_COMMON')) { . ' ' . $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; @@ -988,6 +991,8 @@ if (! defined('PMA_MINIMUM_COMMON')) { $controllink = $userlink; } + $auth_plugin->storeUserCredentials(); + /* Log success */ PMA_logUser($cfg['Server']['user']); diff --git a/libraries/plugins/AuthenticationPlugin.class.php b/libraries/plugins/AuthenticationPlugin.class.php index 8ba6679c39..457de4ca71 100644 --- a/libraries/plugins/AuthenticationPlugin.class.php +++ b/libraries/plugins/AuthenticationPlugin.class.php @@ -38,6 +38,15 @@ abstract class AuthenticationPlugin */ 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 * diff --git a/libraries/plugins/auth/AuthenticationCookie.class.php b/libraries/plugins/auth/AuthenticationCookie.class.php index dd315b42f7..9f67209da0 100644 --- a/libraries/plugins/auth/AuthenticationCookie.class.php +++ b/libraries/plugins/auth/AuthenticationCookie.class.php @@ -560,6 +560,16 @@ class AuthenticationCookie extends AuthenticationPlugin } else { $_SESSION['last_access_time'] = time(); } + } + + /** + * Stores user credentials after successful login. + * + * @return void + */ + public function storeUserCredentials() + { + global $cfg; $this->createIV(); diff --git a/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php b/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php index d77bd7b389..15a73c1638 100644 --- a/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php +++ b/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php @@ -803,13 +803,14 @@ class PMA_AuthenticationCookie_Test extends PHPUnit_Framework_TestCase isset($_SERVER['PHP_AUTH_PW']) ); - $this->assertTrue( - isset($_COOKIE['pmaUser-1']) - ); + // todo: Move to a distinct test for storeUserCredentials() + //$this->assertTrue( + // isset($_COOKIE['pmaUser-1']) + //); - $this->assertTrue( - isset($_COOKIE['pmaPass-1']) - ); + //$this->assertTrue( + // isset($_COOKIE['pmaPass-1']) + //); $arr['password'] = 'testPW'; $arr['host'] = 'b'; diff --git a/url.php b/url.php index 71efc9fb6b..82b224311b 100644 --- a/url.php +++ b/url.php @@ -11,6 +11,10 @@ */ define('PMA_MINIMUM_COMMON', true); require_once './libraries/common.inc.php'; +/** + * JavaScript escaping. + */ +require_once './libraries/js_escape.lib.php'; if (! PMA_isValid($_GET['url']) || ! preg_match('/^https?:\/\/[^\n\r]*$/', $_GET['url']) @@ -24,7 +28,7 @@ if (! PMA_isValid($_GET['url']) // external site. echo ""; // Display redirecting msg on screen.