Review main Merged

57052[BUGFIX] Handle access restrictions on recycler search

Nicole Hummel CR +2 V +2 Easy +21 −8 updated 06/26/19, 12:02

Commit message

Fetching a parent folder may throws an error if the user hasn't
access to the parent. This exception needs to be caught and the
search for an existing recycler folder needs to be stopped
immediately.

Furthermore the patch removes the comparison with the root level
folder but checks the parent folder doesn't equal the folder itself.

Another loop is fixed by calling moveFile on the correct
ResourceStorge and not the current one.

Review

  • Code review CR +2
    • Frans Saris +2
    • Markus Klein +1
  • Verified V +2
    • Frans Saris +2
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 2

Files 1

Review log 3240

Show 1215 earlier messages
  1. Nicole Hummel uploaded patch set 1 05/25/18, 12:05

  2. Nicole Hummel commented on patch set 1 05/25/18, 12:07

    ResourceStorage.php:3047

    CombinedIdentifier isn't needed here as the parent folder always exists in the same storage.
  3. TYPO3com voted on patch set 1 V +1 05/25/18, 12:12 Completed build in 06m 51s on Fri, 25 May, 02:12 PM Test Summary: 31095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23779

  4. Markus Klein commented on patch set 1 V +1 CR +1 05/25/18, 12:31

    tested on v8 with an editor user
  5. Frans Saris commented on patch set 1 CR -1 05/25/18, 15:26

    This breaks the original functionality. Before the move from driver to storage the permission check was not done. So now we should also skip/disable the permission check and just find the closest recycler folder and move the file there. Even if the user hasn't access to the parent folder
  6. Frans Saris commented on patch set 1 05/25/18, 15:53

    I think it will be enough to disable the storage permission check before the move to recycler and enable it again after. This is done more in the core
  7. Nicole Hummel uploaded patch set 2 05/25/18, 16:24

  8. Nicole Hummel commented on patch set 2 05/25/18, 16:28

    > This breaks the original functionality. Before the move from driver > to storage the permission check was not done. So now we should also > skip/disable the permission check and just find the closest > recycler folder and move the file there. Even if the user hasn't > access to the parent folder What do you mean with "original functionality"? Ignoring the access level of users might lead into potential information disclosure. Given to files trees, one with recycler, the other one without, and two users with each access level to one of the trees, the second user would see deleted files from the first user. But that is totally not allowed. So I would not support any patch where access check is ignored.
  9. Markus Klein voted on patch set 2 CR +1 05/25/18, 16:30

  10. TYPO3com voted on patch set 2 V +1 05/25/18, 16:32 Completed build in 07m 58s on Fri, 25 May, 06:32 PM Test Summary: 31095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23785

  11. Frans Saris commented on patch set 2 CR -1 05/25/18, 17:03

    In the old situation where the driver handled the move there wasn't any access check. And that doesn't make sense because the user wants to delete the file. And the admin/integrator enabled the recycler so every file the editor deletes is moved there. This is independent of the access rights of the editor. So, when moving a file to a recycler folder we don't need to check if the user has access to this folder. The user doesn't see the recycler folder in the tree and he doesn't need to. So no information disclosure there. Only when deleting a file we temporary disable the check to be able to move the file to the recycler folder when it is present
  12. Nicole Hummel uploaded patch set 3 05/25/18, 18:04

  13. TYPO3com voted on patch set 3 V -1 05/25/18, 18:04 Completed build in 06s on Fri, 25 May, 08:04 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23787

  14. Nicole Hummel commented on patch set 3 05/25/18, 18:05

    @Frans: Thanks for your explanation. Now I understand your point
  15. Nicole Hummel uploaded patch set 4 05/25/18, 18:07

  1. TYPO3com voted on patch set 4 V -1 05/25/18, 18:07 Completed build in 06s on Fri, 25 May, 08:07 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23788

  2. Nicole Hummel uploaded patch set 5 05/25/18, 18:08

  3. TYPO3com voted on patch set 5 V +1 05/25/18, 18:15 Completed build in 06m 54s on Fri, 25 May, 08:15 PM Test Summary: 31095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23789

  4. Frans Saris commented on patch set 5 05/25/18, 19:35

    Is there no access check during the move?

    ResourceStorage.php:1705

    We need to disable the permission check here to. As in the move the permissions are checked

    ResourceStorage.php:1816

    Same here And wasn't your $storage->moveFile() change correct?
  5. Nicole Hummel uploaded patch set 6 05/25/18, 21:41

  6. Nicole Hummel commented on patch set 5 05/25/18, 21:43

    Hopefully the last one

    ResourceStorage.php:1705 Reply Unresolved

    I moved the permission disabling to the proper places.

    ResourceStorage.php:1816 Reply Unresolved

    It is. I don't know where I lost it again. Now it's back forever :-D
  7. TYPO3com voted on patch set 6 V +1 05/25/18, 21:47 Completed build in 06m 48s on Fri, 25 May, 11:47 PM Test Summary: 31095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23791

  8. Markus Klein commented on patch set 6 05/25/18, 23:45

    ResourceStorage.php:3058

    can we make this more "speaking" by making this a variable $isRootFolder = $folder->getIdentifier() === $parentFolder->getIdentifier(); and appending an "&& !$isRootFolder" to the while condition below. this makes the condition clearer and safes us the additional break here
  9. Nicole Hummel uploaded patch set 7 05/27/18, 13:26

  10. TYPO3com voted on patch set 7 V +1 05/27/18, 13:33 Completed build in 06m 57s on Sun, 27 May, 03:33 PM Test Summary: 31095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23794

  11. Markus Klein commented on patch set 7 V +1 CR +1 05/28/18, 13:44

    tested on v8: tested without existing recycler folder and with recycler folder outside of user's filemount.
  12. Wouter Wolters voted on patch set 7 CR +1 05/28/18, 18:24

  13. Frans Saris commented on patch set 7 CR -1 05/28/18, 18:47

    ResourceStorage.php:1821

    `$this` should be `$storage`

    ResourceStorage.php:1823

    Same here

    ResourceStorage.php:1829

    Same here
  14. Nicole Hummel uploaded patch set 8 05/28/18, 19:42

  15. Nicole Hummel commented on patch set 7 05/28/18, 19:43

    ResourceStorage.php:1821 Reply Unresolved

    Done

    ResourceStorage.php:1823 Reply Unresolved

    Done

    ResourceStorage.php:1829 Reply Unresolved

    Done
  16. Nicole Hummel commented on patch set 8 05/28/18, 19:44

    Thanks you Frans!
  17. TYPO3com voted on patch set 8 V +1 05/28/18, 19:50 Completed build in 07m 46s on Mon, 28 May, 09:50 PM Test Summary: 31122 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23844

  18. Frans Saris voted on patch set 8 CR +1 05/28/18, 20:38

  19. Markus Klein voted on patch set 8 V +1 CR +1 05/28/18, 20:48

  20. Frans Saris commented on patch set 8 05/31/18, 18:00

    verifying now
  21. Frans Saris commented on patch set 8 V +2 CR +2 05/31/18, 18:12

    Tested moving files between storages and deleting files as admin and as editor
  22. Frans Saris merged patch set 9 05/31/18, 18:12

  23. Frans Saris commented on patch set 9 05/31/18, 18:12

    Cherry Picked This patchset was cherry picked to branch TYPO3_8-7 as commit 111133791f7e679eb79bc547a276b7448fbb6647
  24. Markus Klein commented on patch set 9 06/26/19, 11:54

    ResourceStorage.php:3043

    This fails when the storage is not browsable! (capability) Ultimately leading to the problem, that $storage->deleteFile() can't be used on storages which are not browsable. (e.g. remote storages with a custom driver)
  25. Markus Klein commented on patch set 9 06/26/19, 12:02

    ResourceStorage.php:3043 Reply Unresolved