Issue Bug Closed

#100040Properly validate start module

Dmitry Dulepov 02/27/23, 14:42 updated 03/14/23, 11:47

Description

BackendController::getStartupModule() checks for the ‘startModule’ incorrectly. The code is:

                } elseif ($this->moduleLoader->checkMod($beUser->uc['startModule'] ?? '') !== 'notFound') {
                    $startModule = $beUser->uc['startModule'];

Method checkMod can return string, bool or array. Only array means that that the module exists and available. String and bool (which can only be false) mean that the module should not be used. Therefore the check should be like:

                } elseif (is_array($this->moduleLoader->checkMod($beUser->uc['startModule'] ?? ''))) {
                    $startModule = $beUser->uc['startModule'];

Reviews 1