Project

General

Profile

Actions

Bug #93805

closed

DeleteUploadsFinisher deletes top level upload folder

Added by Ralf Zimmermann over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Must have
Category:
Form Framework
Target version:
-
Start date:
2021-03-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The initial security fix for Mitigate directly accessible file upload in form framework was designed that way that uploaded files are stored within 2 levels of random named sub folders within the configured "saveToFileMount" path.
While developing the patch there was several refactorings and now only one random named subfolder is created.
While developing the patch the DeleteUploadsFinisher was adjusted to delete 2 levels of parent folders (if these are empty) while UploadedFileReferenceConverter was implemented to generate 2 levels of random named sub folders. The UploadedFileReferenceConverter changes was never adjusted within the DeleteUploadsFinisher.
This finisher now tries to delete 2 levels of parent folders if these are empty instead of one.
If a form upload is configured to save files within "1:/user_upload/test/" (saveToFileMount: '1:/user_upload/test/'), an upload will be saved within "1:/user_upload/test/form_<random>/file.png". Lateron, the DeleteUploadsFinisher delete "1:/user_upload/test/form_<random>/file.png" (ok). If "1:/user_upload/test/form_<random>/" is emty, this folder will be deleted too (ok). If "1:/user_upload/test/" is emty, this folder will be deleted too (not ok).

Actions

Also available in: Atom PDF