Skip to content

Commit ae1c3b3

Browse files
committed
chore: stricter access to testremote endpoint
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
1 parent a9c36c1 commit ae1c3b3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/files_sharing/lib/Controller/ExternalSharesController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ protected function testUrl($remote, $checkVersion = false) {
100100
*
101101
* @param string $remote
102102
* @return DataResponse
103+
* @AnonRateThrottle(limit=5, period=120)
103104
*/
104105
#[PublicPage]
105106
public function testRemote($remote) {
106-
if (str_contains($remote, '#') || str_contains($remote, '?') || str_contains($remote, ';')) {
107+
if (preg_match('%[!#$&\'()*+,;=?@[\]]%', $remote)) {
107108
return new DataResponse(false);
108109
}
109110

0 commit comments

Comments
 (0)