Skip to content

Commit 119d267

Browse files
authored
Update login.processor.php
Cookie with the same name as login form field can break the login process.
1 parent 0a9cbc3 commit 119d267

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

manager/processors/login.processor.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
// initiate the content manager class
4040
// for backward compatibility
4141

42-
$username = $modx->db->escape($modx->htmlspecialchars($_REQUEST['username'], ENT_NOQUOTES));
43-
$givenPassword = $modx->htmlspecialchars($_REQUEST['password'], ENT_NOQUOTES);
44-
$captcha_code = $_REQUEST['captcha_code'];
45-
$rememberme = $_REQUEST['rememberme'];
42+
$username = $modx->db->escape($modx->htmlspecialchars($_POST['username'], ENT_NOQUOTES));
43+
$givenPassword = $modx->htmlspecialchars($_POST['password'], ENT_NOQUOTES);
44+
$captcha_code = $_POST['captcha_code'];
45+
$rememberme = $_POST['rememberme'];
4646
$failed_allowed = $modx->config['failed_login_attempts'];
4747

4848
// invoke OnBeforeManagerLogin event
@@ -174,11 +174,11 @@
174174
// check user password - local authentication
175175
$hashType = $modx->manager->getHashType($dbasePassword);
176176
if($hashType == 'phpass') {
177-
$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
177+
$matchPassword = login($username, $_POST['password'], $dbasePassword);
178178
} elseif($hashType == 'md5') {
179-
$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
179+
$matchPassword = loginMD5($internalKey, $_POST['password'], $dbasePassword, $username);
180180
} elseif($hashType == 'v1') {
181-
$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
181+
$matchPassword = loginV1($internalKey, $_POST['password'], $dbasePassword, $username);
182182
} else {
183183
$matchPassword = false;
184184
}

0 commit comments

Comments
 (0)