Bug #93805
closedDeleteUploadsFinisher deletes top level upload folder
100%
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).
Updated by Gerrit Code Review over 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68562
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68620
Updated by Ralf Zimmermann over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 14b865a5cc1f1969de4f95807703c1867c9ab47e.
Updated by Gerrit Code Review over 3 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68636
Updated by Ralf Zimmermann over 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset 39cc879e1945ef9c4077e19d02e0a0c7df0dbb6b.