xperseguers / t3ext-extractor

TYPO3 Extension extractor
https://extensions.typo3.org/extension/extractor
GNU General Public License v2.0
15 stars 24 forks source link

Lasted changes may cause problems with TYPO3 11.5.35 (and maybe according v12 and v13 versions) #81

Closed sypets closed 7 months ago

sypets commented 7 months ago

After the TYPO3 security update 11.5.35 and using a newer version of extractor (specifically branch bugfix/77-infinite-aperture, but problem is reproducible with master as well).

Reproduce

  1. Use latest TYPO3 (11.5 branch)
  2. Use latest extractor (master branch),
  3. configure extractor to extract with pdfinfo and exiftool
  4. configure fileadmin with automatic metadata extraction
  5. Create a file mount which is not on a top level (e.g. fileadmin/test/images)
  6. Create a user and give this user access to the file mount
  7. Switch to the user and upload a file in the file list

Error message is displayed (but file is successfully uploaded)

image

possible reason

AbstractExtractionService.php, Line 155:

$parentFolder = $file->getParentFolder();

This is relatively new, see

error log / Exception

You are not allowed to access the given folder: "test"- InsufficientFolderAccessPermissionsException: You are not allowed to access the given folder: "test",

Fri, 16 Feb 2024 10:33:30 +0000 [CRITICAL] request="cfaa2069ef6d7" component="TYPO3.CMS.Core.Error.DebugExceptionHandler": Core: Exception handler (WEB: BE): 
TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException, code #1375955684, 
file /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php, line 879: 
You are not allowed to access the given folder: "test"- InsufficientFolderAccessPermissionsException: You are not allowed to access the given folder: "test", 
in file /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php:879 - {"mode":"WEB","application_mode":"BE","exception_class":"TYPO3\\CMS\\Core\\Resource\\Exception\\InsufficientFolderAccessPermissionsException","exception_code":1375955684,"file":"/var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php","line":879,"message":"You are not allowed to access the given folder: \"test\"","request_url":"http://t3coredev11/typo3/ajax/file/process?token=--AnonymizedToken--","exception":"TYPO3\\CMS\\Core\\Resource\\Exception\\InsufficientFolderAccessPermissionsException: You are not allowed to access the given folder: \"test\" in /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php:879

Stack trace:
#0 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php(2600): TYPO3\\CMS\\Core\\Resource\\ResourceStorage->assureFolderReadPermission()
#1 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/Folder.php(556): TYPO3\\CMS\\Core\\Resource\\ResourceStorage->getFolder()
#2 /var/www/t3coredev11/typo3conf/ext/extractor/Classes/Service/Extraction/AbstractExtractionService.php(161): TYPO3\\CMS\\Core\\Resource\\Folder->getParentFolder()
#3 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/Service/ExtractorService.php(46): Causal\\Extractor\\Service\\Extraction\\AbstractExtractionService->canProcess()
#4 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/Index/Indexer.php(114): TYPO3\\CMS\\Core\\Resource\\Service\\ExtractorService->extractMetaData()
#5 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php(2158): TYPO3\\CMS\\Core\\Resource\\Index\\Indexer->updateIndexEntry()
#6 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/ResourceStorage.php(2190): TYPO3\\CMS\\Core\\Resource\\ResourceStorage->replaceFile()
#7 /var/www/t3coredev11/typo3/sysext/core/Classes/Resource/Folder.php(325): TYPO3\\CMS\\Core\\Resource\\ResourceStorage->addUploadedFile()
xperseguers commented 7 months ago

Thanks for the detailed ticket.