Title: Typo3 v4.5-4.7-Remote Code Execution (RFI/LFI)
Author: MaXe
: Https://typo3.org/download/
Affected Versions: 4.5.0 up to 4.5.8, 4.6.0 and 4.6.1 (+ development releases
4.7 branch)
Introduction:
TYPO3 is a small to midsize enterprise-class Content Management Framework
Offering
The best of both worlds: out-of-the-box operation with a complete set
Standard
Modules and a clean and sturdy high-performance architecture accomodating
Virtually
Every kind of custom solution or extension.
External Links:
Http://typo3.org/
-: The Advisory ::-
Requirements for any RCE:
-Register_globals in the php. ini MUST be enabled (if the exploit fails
Against a supposed to be vulnerable version, this is why. This setting is
Often 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 (direct
Access 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/RFI % 00 www.2cto.com
The vulnerable piece of code: require_once ($ GLOBALS ['back _ path'].
'Template. php ');
Demonstrates, that it is necessary to append a null-byte (% 00) after
Maliciously crafted input/URL. (Unless your remote file if applicable, is
Named something. template. php)
-: Solution ::-
* Upgrade to the latest version or change the vulnerable piece
Code 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/
-
Http://news.typo3.org/news/article/important-security-bulletin-pre-announcement-2/