diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2024-03-15 11:46:19 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2024-03-21 10:34:55 +0100 |
commit | 2792d8b3f526e4a55aae35d2a2a7ec9d42025a67 (patch) | |
tree | 64cf9354cc81ffc09f38d99f66c49addd50e6796 /core/Controller/LoginController.php | |
parent | 03f269829f4597a3c258da38b1a0b5b2214acefa (diff) | |
download | nextcloud-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.php | 13 |
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, |