Skip to content

Commit cecd778

Browse files
nickvergessennextcloud-command
authored andcommitted
Fix password length limitation
Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 4beffc4 commit cecd778

6 files changed

Lines changed: 13 additions & 6 deletions

File tree

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);
@@ -882,6 +885,9 @@ public function editUser(string $userId, string $key, string $value): DataRespon
882885
break;
883886
case self::USER_FIELD_PASSWORD:
884887
try {
888+
if (strlen($value) > 469) {
889+
throw new OCSException('Invalid password value', 102);
890+
}
885891
if (!$targetUser->canChangePassword()) {
886892
throw new OCSException('Setting the password is not supported by the users backend', 103);
887893
}

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)