Review main Merged

96681[FEATURE] Restrict file extensions per storage and mount

Oli Bartsch CR +2 V +2 Expert +1498 −50 updated 10/29/26, 17:26

Commit message

File storages get the new option "allowedFileExtensions" in
file-storages.yaml, file mount records the new field "Allowed file
extensions". ResourceStorage rejects adding, uploading, creating and
copying a file with another extension, moving one in from elsewhere
and renaming or moving one to a different extension. Moving or copying
a folder checks the visible files it contains, and the file list
reports a rejected folder operation as a message.

The backend shows the allowed file extensions where files are added,
and the drag uploader rejects other files right away. Online media
providers and new text files are only offered if their file extension
is allowed in the folder.

File mount lists apply to backend users only and add up like other
mount permissions. Files already in place stay manageable as long as
they keep their extension, and the file deny pattern is still
evaluated first. This includes files written to the storage without
TYPO3, e.g. by FTP or to a shared bucket: they are indexed and listed
as before, as the restriction guards operations, it is no filter.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 27

Show 7 more files

Review log 3244

Show 1219 earlier messages
  1. Oli Bartsch uploaded patch set 1 10/14/26, 13:22

  2. Mathias Brodala commented on patch set 1 10/14/26, 13:23

    Shouldn't this be coordinated with https://review.typo3.org/c/Packages/TYPO3.CMS/+/95980 ?
  3. core-ci voted on patch set 1 V +1 10/14/26, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111106

  4. Oli Bartsch commented on patch set 1 10/14/26, 13:38

    Reply

    Sure, will rebase once this is merged.
  5. Benni Mack commented on patch set 1 10/15/26, 10:27

    how do we deal with storages where files were added by an outsider (FTP, External S3 storage etc)?
  6. Oli Bartsch uploaded patch set 2 V +1 10/16/26, 16:24

  7. Oli Bartsch commented on patch set 2 10/16/26, 16:27

    Reply

    Done

    Reply

    Nothing changes for them: the restriction only guards ResourceStorage operations, it doesn't filter anything. Files written by FTP or to a shared bucket are indexed and listed as before, and stay manageable as long as they keep their extension.
  8. core-ci voted on patch set 2 V -1 10/16/26, 16:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111382

  9. Oli Bartsch uploaded patch set 3 V -1 10/17/26, 07:47

  10. core-ci voted on patch set 3 V +1 10/17/26, 07:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111428

  11. Oli Bartsch rebased onto patch set 4 V +1 10/19/26, 09:43

  12. core-ci voted on patch set 4 V -1 10/19/26, 10:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111617

  13. Oli Bartsch uploaded patch set 5 V -1 10/19/26, 10:35

  14. core-ci voted on patch set 5 V +1 10/19/26, 10:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111620

  15. Garvin Hicking commented on patch set 5 10/19/26, 15:40

    BackendUserAuthentication.php:1342

    Reading this as a human, I don't get it 😄

    ResourceStorage.php:558

    Occurs again, maybe centralize this iteration/filter logic?

    ResourceStorage.php:849

    The "FileExtensionFilter" class really hurts and should be made stateless as a prepatch? 🙏

    sys_filemounts.php:51

    please use the domain syntax for new labels please
  16. Oli Bartsch uploaded patch set 6 10/19/26, 16:28

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  17. Oli Bartsch uploaded patch set 7 V +1 10/19/26, 16:31

  18. core-ci voted on patch set 6 V +1 10/19/26, 16:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111677

  19. core-ci voted on patch set 7 V +1 10/19/26, 16:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111678

  1. Oli Bartsch commented on patch set 7 10/19/26, 16:47

    BackendUserAuthentication.php:1342 Reply

    Done

    ResourceStorage.php:558 Reply

    Done

    ResourceStorage.php:849 Reply

    Agreed that it hurts, but making it stateless is public API work and needs its own deprecation. This patch no longer uses FileExtensionFilter at all.

    sys_filemounts.php:51 Reply

    Done
  2. Garvin Hicking voted on patch set 7 CR +1 10/19/26, 21:15

  3. Georg Ringer commented on patch set 7 V -1 10/20/26, 19:10

    - why is the allowedFileExtensions not inside "configuration"? - I added mp4 only and if I click in the storage on "add file" I expect no online media and also no option to create new text files - Maybe a small flash message would be helpful to tell editors and myself which files are allowed in the storage, because how should I know - by testing every extension?
  4. Oli Bartsch uploaded patch set 8 CR +1 V +1 10/20/26, 19:30

  5. Oli Bartsch commented on patch set 8 10/20/26, 19:31

    Reply

    - allowedFileExtensions is a storage option, not a driver option: "configuration" is handed to the driver as-is (basePath, pathType, ...), while the restriction is enforced by ResourceStorage. Same level as processingFolder or writable. - "Add file" now offers online media providers and new text files only if their file extension is allowed in the folder, and hides a form when nothing is left. - Instead of a flash message, the allowed file extensions are shown where files are added, and the drag uploader rejects other files right away, naming the allowed ones.
  6. core-ci voted on patch set 8 V +1 10/20/26, 19:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111930

  7. Simon Schaufelberger commented on patch set 8 10/20/26, 22:02

    Feature-103594-AllowedFileExtensionsPerStorageAndFileMount.rst:87

    line is longer than the limit
  8. Oli Bartsch commented on patch set 8 10/21/26, 05:50

    Feature-103594-AllowedFileExtensionsPerStorageAndFileMount.rst:87 Reply

    Hey, which Limit are you referring to?
  9. Oli Bartsch uploaded patch set 9 V +1 10/21/26, 08:44

  10. Oli Bartsch uploaded patch set 10 10/21/26, 08:49

  11. Oli Bartsch commented on patch set 9 10/21/26, 08:51

    Feature-103594-AllowedFileExtensionsPerStorageAndFileMount.rst:87 Reply

    Done
  12. core-ci voted on patch set 9 V +1 10/21/26, 08:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111979

  13. core-ci voted on patch set 10 V +1 10/21/26, 09:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111980

  14. Georg Ringer commented on patch set 10 V -1 10/21/26, 18:11

    way better. however if enabling [jpg,youtube], now it allowes to upload a youtube file which is however just a online media file extension. if no restriction is set, youtube is not in the list of files for allowed uploads
  15. Simon Schaufelberger commented on patch set 10 10/21/26, 18:19

    Feature-103594-AllowedFileExtensionsPerStorageAndFileMount.rst:87 Reply

  16. Oli Bartsch uploaded patch set 11 V +1 10/21/26, 19:26

  17. Oli Bartsch commented on patch set 11 10/21/26, 19:29

    Reply

    Fixed
  18. core-ci voted on patch set 11 V +1 10/21/26, 19:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112038

  19. Georg Ringer voted on patch set 11 CR +1 V +1 10/21/26, 19:45

  20. Oli Bartsch uploaded patch set 12 CR +1 V +1 10/24/26, 20:29

  21. core-ci voted on patch set 12 V +1 10/24/26, 20:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112436

  22. Simon Schaufelberger voted on patch set 12 CR +1 V +1 10/24/26, 20:56

  23. Georg Ringer voted on patch set 12 CR +1 V +1 10/29/26, 16:16

  24. Oli Bartsch voted on patch set 12 CR +2 V +2 10/29/26, 17:26

  25. Oli Bartsch merged patch set 13 10/29/26, 17:26