Skip to content

Commit 38752c9

Browse files
authored
Merge pull request #34532 from nextcloud/backport/34500/stable24
[stable24] Fix password length limitation
2 parents 9b11997 + 9943387 commit 38752c9

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
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/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"

dist/settings-users-8351.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.

dist/settings-users-8351.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.

dist/settings-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.

dist/settings-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.

0 commit comments

Comments
 (0)