aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/LoginController.php
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2024-03-15 11:46:19 +0100
committerfenn-cs <fenn25.fn@gmail.com>2024-03-21 10:34:55 +0100
commit2792d8b3f526e4a55aae35d2a2a7ec9d42025a67 (patch)
tree64cf9354cc81ffc09f38d99f66c49addd50e6796 /core/Controller/LoginController.php
parent03f269829f4597a3c258da38b1a0b5b2214acefa (diff)
downloadnextcloud-server-2792d8b3f526e4a55aae35d2a2a7ec9d42025a67.tar.gz
nextcloud-server-2792d8b3f526e4a55aae35d2a2a7ec9d42025a67.zip
feat: Limit email input on auth pages to 255 chars
Excessively long emails reported make server unresponsive. We could at some point, consider adding a configuration for sysadmins to bypass this setting on their instance if they want. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'core/Controller/LoginController.php')
-rw-r--r--core/Controller/LoginController.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index fb60f0feccc..90c49549249 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -336,9 +336,20 @@ class LoginController extends Controller {
);
}
+ $user = trim($user);
+
+ if (strlen($user) > 255) {
+ return $this->createLoginFailedResponse(
+ $user,
+ $user,
+ $redirect_url,
+ $this->l10n->t('Unsupported email length (>255)')
+ );
+ }
+
$data = new LoginData(
$this->request,
- trim($user),
+ $user,
$password,
$redirect_url,
$timezone,