summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2022-10-12 09:51:01 +0200
committerGitHub <noreply@github.com>2022-10-12 09:51:01 +0200
commit38752c9fce6a5fa1f7fa7b55079c1f19deb907d2 (patch)
tree53efa831ca3591c5b3b55049ab17795773474f31 /apps
parent9b119972aafa9099518073f54514e528ef3b2013 (diff)
parent9943387afdee9d2aa88f1d07b5dd002755259bd4 (diff)
downloadnextcloud-server-38752c9fce6a5fa1f7fa7b55079c1f19deb907d2.tar.gz
nextcloud-server-38752c9fce6a5fa1f7fa7b55079c1f19deb907d2.zip
Merge pull request #34532 from nextcloud/backport/34500/stable24
[stable24] Fix password length limitation
Diffstat (limited to 'apps')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php6
-rw-r--r--apps/settings/src/components/UserList.vue1
2 files changed, 7 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 49ad5c21521..8a227b7124e 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -389,6 +389,9 @@ class UsersController extends AUserData {
}
$generatePasswordResetToken = false;
+ if (strlen($password) > 469) {
+ throw new OCSException('Invalid password value', 101);
+ }
if ($password === '') {
if ($email === '') {
throw new OCSException('To send a password link to the user an email address is required.', 108);
@@ -873,6 +876,9 @@ class UsersController extends AUserData {
break;
case self::USER_FIELD_PASSWORD:
try {
+ if (strlen($value) > 469) {
+ throw new OCSException('Invalid password value', 102);
+ }
if (!$targetUser->canChangePassword()) {
throw new OCSException('Setting the password is not supported by the users backend', 103);
}
diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue
index 4d50da62596..5d6890514ad 100644
--- a/apps/settings/src/components/UserList.vue
+++ b/apps/settings/src/components/UserList.vue
@@ -56,6 +56,7 @@
ref="newuserpassword"
v-model="newUser.password"
:minlength="minPasswordLength"
+ :maxlength="469"
:placeholder="t('settings', 'Password')"
:required="newUser.mailAddress===''"
autocapitalize="none"