Merge pull request from GHSA-cmgc-h4cx-3v43

doc: Make sure to correctly access images
This commit is contained in:
Johannes Meyer 2021-07-12 09:51:23 +02:00 committed by GitHub
commit 6c03c80f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}