[SECURITY] Disallow access to fallback storage '0' 08/40808/2
authorNicole Cordes <typo3@cordes.co>
Wed, 17 Jun 2015 11:11:14 +0000 (13:11 +0200)
committerBenjamin Mack <benni@typo3.org>
Wed, 1 Jul 2015 14:09:53 +0000 (16:09 +0200)
All users with access to the filelist module are able to display the
content of the document root folder by spoofing the url.

This patch prevents any rendering from that storage and throws an error.

Resolves: #67538
Releases: master, 6.2
Security-Bulletin: TYPO3-CORE-SA-2015-005
Change-Id: I59cc315e913c02001efdad23e2ded7385502c5f2
Reviewed-on: http://review.typo3.org/40808
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/filelist/Classes/Controller/FileListController.php

index fb6a79b..c7bace2 100644 (file)
@@ -142,6 +142,7 @@ class FileListController {
         *
         * @return void
         * @throws \RuntimeException
+        * @throws Exception\InsufficientFolderAccessPermissionsException
         */
        public function init() {
                // Setting GPvars:
@@ -163,9 +164,12 @@ class FileListController {
                                }
 
                                $this->folderObject = $fileFactory->getFolderObjectFromCombinedIdentifier($storage->getUid() . ':' . $identifier);
+                               // Disallow access to fallback storage 0
+                               if ($storage->getUid() === 0) {
+                                       throw new Exception\InsufficientFolderAccessPermissionsException('You are not allowed to access files outside your storages', 1434539815);
+                               }
                                // Disallow the rendering of the processing folder (e.g. could be called manually)
-                               // and all folders without any defined storage
-                               if ($this->folderObject && ($storage->getUid() === 0 || $storage->isProcessingFolder($this->folderObject))) {
+                               if ($this->folderObject && $storage->isProcessingFolder($this->folderObject)) {
                                        $this->folderObject = $storage->getRootLevelFolder();
                                }
                        } else {