From 7699598b9449f3636af0eb9f328ae422449d07a0 Mon Sep 17 00:00:00 2001 From: Benjamin Gaussorgues Date: Thu, 28 Nov 2024 11:05:06 +0100 Subject: [PATCH] chore: stricter access to testremote endpoint Signed-off-by: Benjamin Gaussorgues --- apps/files_sharing/lib/Controller/ExternalSharesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/ExternalSharesController.php b/apps/files_sharing/lib/Controller/ExternalSharesController.php index 70e9eb5c46514..e7189dabfbd95 100644 --- a/apps/files_sharing/lib/Controller/ExternalSharesController.php +++ b/apps/files_sharing/lib/Controller/ExternalSharesController.php @@ -100,10 +100,11 @@ protected function testUrl($remote, $checkVersion = false) { * * @param string $remote * @return DataResponse + * @AnonRateThrottle(limit=5, period=120) */ #[PublicPage] public function testRemote($remote) { - if (str_contains($remote, '#') || str_contains($remote, '?') || str_contains($remote, ';')) { + if (preg_match('%[!#$&\'()*+,;=?@[\]]%', $remote)) { return new DataResponse(false); }