Issue Bug Closed

#103813Infinite loop in EXT:lowlevel ConfigurationController

Stefan Froemken 05/10/24, 09:30 updated 07/09/24, 15:35

Description

Hello,

I get an infinite loop problem in Configuration Module of TYPO3 backend. Problem is an extension which registers a hook that way in ext_localconf.php:

<?php
if (!defined('TYPO3')) {
    die('Access denied.');
}

call_user_func(static function(): void {
    // call very first TYPO3 hook for redirecting requests
    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'][] = function($parameters, $parent) {
        $login = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
            \EinsZuEins\Login1zu1\UserFunc\Login::class
        );
        $login->main($parameters, $parent);
    };
});

Problem are these both lines:
https://github.com/TYPO3/typo3/blob/v12.4.14/typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php#L94-L95

It loops through the $tree array and $value becomes a PHP:Closure. Yes Closure is an object and is not traverseable. So, with these lines you make an array again which results into the infinite loop.

Nice greetings

Stefan

Reviews 2