Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-03-12 15:43:29 +0300
committerJoas Schilling <coding@schilljs.com>2020-03-12 15:44:48 +0300
commit3930ab8e8a72190933931b256aea78c3cd239953 (patch)
tree8cf39781d84eca30734afefd0cabb5f966a0ba86 /apps/files_sharing/lib/Controller
parenta5b0f41a9ffc570319abbae24b1e82128f3171a6 (diff)
Don't allow anchors and queries in remote urls
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r--apps/files_sharing/lib/Controller/ExternalSharesController.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ExternalSharesController.php b/apps/files_sharing/lib/Controller/ExternalSharesController.php
index d9be124b2ee..f903871ffd6 100644
--- a/apps/files_sharing/lib/Controller/ExternalSharesController.php
+++ b/apps/files_sharing/lib/Controller/ExternalSharesController.php
@@ -130,6 +130,9 @@ class ExternalSharesController extends Controller {
* @return DataResponse
*/
public function testRemote($remote) {
+ if (strpos($remote, '#') !== false || strpos($remote, '?') !== false) {
+ return new DataResponse(false);
+ }
if (
$this->testUrl('https://' . $remote . '/ocs-provider/') ||
$this->testUrl('https://' . $remote . '/ocs-provider/index.php') ||