SirGod Posted January 4, 2012 Report Posted January 4, 2012 Typo3 e un script foarte folosit. Problema este ca pentru a exploata vulnerabilitatea e nevoie de register_globals ON (sanse mici spre foarte mici).# Exploit Title: Typo3 v4.5-4.7 - Remote Code Execution (RFI/LFI)# Date: 4th January 2012# Author: MaXe# Software Link: https://typo3.org/download/# Version: 4.5.0 up to 4.5.8, 4.6.0 and 4.6.1 (+ development releases of4.7 branch)Typo3 v4.5-4.7 - Remote Code Execution (RFI/LFI)Versions Affected: 4.5.0 up to 4.5.8, 4.6.0 and 4.6.1 (+ developmentreleases of 4.7 branch)Info:TYPO3 is a small to midsize enterprise-class Content Management Frameworkofferingthe best of both worlds: out-of-the-box operation with a complete set ofstandardmodules and a clean and sturdy high-performance architecture accomodatingvirtuallyevery kind of custom solution or extension.External Links:TYPO3 - the Enterprise Open Source CMS: HomeCredits: Björn Pedersen and Christian Toffolo who discovered and reportedthe issue and the Security Team member Helmut Hummel for providing thepatch.(This advisory was rewritten by MaXe @InterN0T to offer a quick overviewof the vulnerability, including the removal of all irrelevant and untruedetails.-:: The Advisory ::-Requirements for any RCE:- register_globals in the php.ini MUST be enabled (if the exploit failsagainst a supposed to be vulnerable version, this is why. This setting isoften disabled by default.)Requirements for RFI:- allow_url_include has to be enabled (It's often "off" by default.)Proof of Concept:By browsing to a script / page, that uses the following file:typo3/sysext/workspaces/Classes/Controller/AbstractController.php (directaccess may not be allowed)It is possible to include PHP code to be executed via the "BACK_PATH"global variable. This can be accessed in ways like:AbstractController.php?BACK_PATH=LFI/RFIThe vulnerable piece of code: require_once($GLOBALS['BACK_PATH'] .'template.php');Demonstrates, that it is necessary to append a null-byte ( ) after themaliciously crafted input / URL. (Unless your remote file if applicable, isnamed something.template.php)-:: Solution ::-* Update to the latest version of Typo3 OR change the vulnerable piece ofcode to: require_once(PATH_site . TYPO3_mainDir . 'template.php');References:- http://typo3.org/fileadmin/security-team/bug32571/32571.diff-https://typo3.org/teams/security/security-bulletins/typo3-core/typo3-core-sa-2011-004/-news.typo3.org: Important Security-Bulletin Pre-Announcement Quote