From 90e23ebaf3c65f965107324a176a175606d4ff7d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 9 Nov 2020 11:40:12 +0100 Subject: [PATCH] doc: Make sure to correctly access images --- modules/doc/application/controllers/ModuleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index 3b65b23b0..47dfb1c14 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -139,7 +139,7 @@ class ModuleController extends DocController $image = $this->params->getRequired('image'); $docPath = $this->getPath($module, Icinga::app()->getModuleManager()->getModuleDir($module, '/doc')); $imagePath = realpath($docPath . '/' . $image); - if ($imagePath === false) { + if ($imagePath === false || substr($imagePath, 0, strlen($docPath)) !== $docPath) { $this->httpNotFound('%s does not exist', $image); }