Skip to content

Commit ff7a816

Browse files
nickvergessennextcloud-command
authored andcommitted
Fix password length limitation
Signed-off-by: Joas Schilling <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
1 parent f3acaf6 commit ff7a816

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ public function addUser(
389389
}
390390

391391
$generatePasswordResetToken = false;
392+
if (strlen($password) > 469) {
393+
throw new OCSException('Invalid password value', 101);
394+
}
392395
if ($password === '') {
393396
if ($email === '') {
394397
throw new OCSException('To send a password link to the user an email address is required.', 108);
@@ -873,6 +876,9 @@ public function editUser(string $userId, string $key, string $value): DataRespon
873876
break;
874877
case self::USER_FIELD_PASSWORD:
875878
try {
879+
if (strlen($value) > 469) {
880+
throw new OCSException('Invalid password value', 102);
881+
}
876882
if (!$targetUser->canChangePassword()) {
877883
throw new OCSException('Setting the password is not supported by the users backend', 103);
878884
}

apps/settings/js/vue-settings-apps-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-apps-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-users.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/js/vue-settings-users.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/settings/src/components/UserList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
ref="newuserpassword"
5757
v-model="newUser.password"
5858
:minlength="minPasswordLength"
59+
:maxlength="469"
5960
:placeholder="t('settings', 'Password')"
6061
:required="newUser.mailAddress===''"
6162
autocapitalize="none"

0 commit comments

Comments
 (0)