[SECURITY] Disallow access to fallback storage '0' 15/40815/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:17:46 +0000 (16:17 +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: Ia503c572e550aaa3e74ffbaf3da87796ad04723a
Reviewed-on: http://review.typo3.org/40815
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/filelist/Classes/Controller/FileListController.php

index 7784564..b69e9dd 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 {