From 39b15269c99a2b6d123ddb75b9c00c9356720dfd Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 6 Sep 2021 10:46:12 +0000 Subject: Check if SVG path is valid Signed-off-by: Lukas Reschke --- core/Controller/SvgController.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core') diff --git a/core/Controller/SvgController.php b/core/Controller/SvgController.php index ff0a21ba516..3aa9e73c859 100644 --- a/core/Controller/SvgController.php +++ b/core/Controller/SvgController.php @@ -32,6 +32,7 @@ declare(strict_types=1); namespace OC\Core\Controller; +use OC\Files\Filesystem; use OC\Template\IconsCacher; use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; @@ -118,6 +119,10 @@ class SvgController extends Controller { * @return DataDisplayResponse|NotFoundResponse */ private function getSvg(string $path, string $color, string $fileName) { + if(!Filesystem::isValidPath($path)) { + return new NotFoundResponse(); + } + if (!file_exists($path)) { return new NotFoundResponse(); } -- cgit v1.2.3