Skip to content

Commit 618ffaf

Browse files
committed
Revert "Update password minimum/generated lengths to NTIS 2025 security guidelines"
This reverts commit 95c9d63.
1 parent 95c9d63 commit 618ffaf

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

core/src/Revolution/Processors/Security/Profile/ChangePassword.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function process()
5050

5151
$password = $this->getProperty('password_new');
5252
if (!$this->getProperty('password_method_screen')) {
53-
$length = (integer)$this->modx->getOption('password_min_length', null, 12);
53+
$length = (integer)$this->modx->getOption('password_min_length', null, 8);
5454
$password = str_repeat('*', mt_rand($length, strlen($this->getProperty('password_new')) * 2));
5555
}
5656

@@ -68,7 +68,7 @@ public function validate()
6868
$this->addFieldError('password_old', $this->modx->lexicon('user_err_password_invalid_old'));
6969
}
7070

71-
if (empty($newPassword) || strlen($newPassword) < $this->modx->getOption('password_min_length', null, 12)) {
71+
if (empty($newPassword) || strlen($newPassword) < $this->modx->getOption('password_min_length', null, 8)) {
7272
$this->addFieldError('password_new', $this->modx->lexicon('user_err_password_too_short'));
7373
} else {
7474
if (!preg_match('/^[^\'\x3c\x3e\(\);\x22\x7b\x7d\x2f\x5c]+$/', $newPassword)) {

core/src/Revolution/Processors/Security/Profile/Update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function validate()
117117
if (!$this->modx->user->passwordMatches($oldPassword)) {
118118
$this->addFieldError('password_old', $this->modx->lexicon('user_err_password_invalid_old'));
119119
}
120-
if (empty($newPassword) || strlen($newPassword) < $this->modx->getOption('password_min_length', null, 12)) {
120+
if (empty($newPassword) || strlen($newPassword) < $this->modx->getOption('password_min_length', null, 8)) {
121121
$this->addFieldError('password_new', $this->modx->lexicon('user_err_password_too_short'));
122122
} elseif (!preg_match('/^[^\'\x3c\x3e\(\);\x22\x7b\x7d\x2f\x5c]+$/', $newPassword)) {
123123
$this->addFieldError('password_new', $this->modx->lexicon('user_err_password_invalid'));

core/src/Revolution/Processors/Security/User/Validation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function checkPassword()
101101
$this->processor->addFieldError('specifiedpassword', $this->modx->lexicon('user_err_not_specified_password'));
102102
} elseif ($specifiedPassword != $confirmPassword) {
103103
$this->processor->addFieldError('confirmpassword', $this->modx->lexicon('user_err_password_no_match'));
104-
} elseif (strlen($specifiedPassword) < $this->modx->getOption('password_min_length', null, 12, true)) {
104+
} elseif (strlen($specifiedPassword) < $this->modx->getOption('password_min_length', null, 8, true)) {
105105
$this->processor->addFieldError('specifiedpassword', $this->modx->lexicon('user_err_password_too_short'));
106106
} elseif (!preg_match('/^[^\'\x3c\x3e\(\);\x22\x7b\x7d\x2f\x5c]+$/', $specifiedPassword)) {
107107
$this->processor->addFieldError('specifiedpassword', $this->modx->lexicon('user_err_password_invalid'));

core/src/Revolution/modUser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,10 @@ public function removeLocks(array $options = [])
897897
public function generatePassword($length = null, array $options = [])
898898
{
899899
if ($length === null) {
900-
$length = (int)$this->xpdo->getOption('password_generated_length', null, 16, true);
900+
$length = (int)$this->xpdo->getOption('password_generated_length', null, 10, true);
901901
}
902902

903-
$passwordMinimumLength = (int)$this->xpdo->getOption('password_min_length', null, 12, true);
903+
$passwordMinimumLength = (int)$this->xpdo->getOption('password_min_length', null, 8, true);
904904
if ($length < $passwordMinimumLength) {
905905
$length = $passwordMinimumLength;
906906
}

0 commit comments

Comments
 (0)