Review main Merged

70056[BUGFIX] Prevent workspace access checks for dummy user

Ingo Fabbri CR +2 V +2 Easy +36 −2 updated 11/22/21, 16:12

Commit message

The backend usergroup compare view requires to fetch the
group data of the groups to compare. Since this operation
depends on a user array, UserInformationService creates
such dummy user.

Since #93233 the dummy user array also contains a workspace
id `-99`.

To successfully overcome workspace access-checks, set
the admin-flag for this fake-user. Use workspace uid 0,
to avoid any database operations on workspace access
checks. Workspace 0 additionally prevents the log-message,
which led to the exception message described at #93894.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 4254

Show 2229 earlier messages
  1. Ingo Fabbri uploaded patch set 1 07/22/21, 19:18

  2. core-ci voted on patch set 1 V +1 07/22/21, 19:30 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13680

  3. Oli Bartsch commented on patch set 1 07/22/21, 21:35

    Hi, thanks for providing a patch for this. Unfortunately this still leads to the "Out of bounds" exception, which means that there are still sys_log entries created. This should not happen as it's only a "dummy user scenario".
  4. Ingo Fabbri commented on patch set 1 07/22/21, 21:39

    Reply

    Can you provide a case where that still happens?
  5. Oli Bartsch commented on patch set 1 07/22/21, 22:08

    Reply

    Just applied the patch, added 3 groups and clicked "compare". I'll have a detailed look into it tomorrow.
  6. Ingo Fabbri commented on patch set 1 07/23/21, 05:44

    Reply

    to be honest: i did not test all cases I described in the commit message. As the exception was caused by a log message that should only be logged, when workspace-id is different to current-user-workspace-id - it looked like a solid hotfix for the forge issue.
  7. Benni Mack uploaded patch set 2 10/20/21, 15:52

  8. core-ci voted on patch set 2 V +1 10/20/21, 16:15 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18389

  9. Oli Bartsch uploaded patch set 3 11/17/21, 14:48

  10. core-ci voted on patch set 3 V -1 11/17/21, 14:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19405

  11. Oli Bartsch uploaded patch set 4 11/17/21, 14:51

  12. core-ci voted on patch set 4 V +1 11/17/21, 15:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19406

  13. Jochen Roth voted on patch set 4 V +1 CR +1 11/17/21, 18:03

  14. Ingo Fabbri commented on patch set 4 CR -1 11/17/21, 18:41

    I assume this does not resolve the forge issue I reported. Not having verified the current patchset, but adming-flag does not omit the log-message that all here is about.
  15. Oli Bartsch commented on patch set 4 11/17/21, 19:54

    Reply

    I'm pretty sure it does. As I wrote in the commit message "this prevents any further workspace access checks". This means, no workspace switch has to be performed because admin is allowed to access any workspace => Therefore no log entry about "switched workspaces" is created. Could you please check the latest patchset?
  16. Benni Mack updated the commit message in patch set 5 11/18/21, 10:51

  17. core-ci voted on patch set 5 V +1 11/18/21, 12:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19491

  18. Jochen Roth voted on patch set 5 V +1 CR +1 11/18/21, 22:49

  19. Ingo Fabbri voted on patch set 5 CR -1 11/19/21, 04:15

  20. Ingo Fabbri commented on patch set 5 11/19/21, 04:18

    and finally this patch does more than it should. these null coalesce changes should not be part of the fix.
  21. Ingo Fabbri commented on patch set 5 11/19/21, 04:22

    Reply

    and this latest patchset may work only by coincidence. as long as you do not use ext:workspaces and work in default/live workspace.
  22. Oli Bartsch uploaded patch set 6 11/19/21, 08:26

  23. Oli Bartsch commented on patch set 6 11/19/21, 08:31

    Moved the PHP8 fixes into another patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/72238
  24. Oli Bartsch commented on patch set 6 11/19/21, 08:39

    Reply

    Please verify and report the scenario which does not work for you.
  25. core-ci voted on patch set 6 V +1 11/19/21, 08:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19541

  26. Oli Bartsch uploaded patch set 7 11/19/21, 15:26

  27. core-ci voted on patch set 7 V +1 11/19/21, 15:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19566

  28. Ingo Fabbri commented on patch set 7 V -1 CR -1 11/19/21, 22:11

    This is going nowhere. What was wrong with patchset 1 actually?
  29. Oli Bartsch commented on patch set 7 11/19/21, 22:22

    Reply

    As already mentioned in my comment from Jul 22, it did not fix the bug. What's your reason for voting -1? Is there something wrong with the code? Do you still encounter the bug with the latest patchset?
  1. Ingo Fabbri commented on patch set 7 11/19/21, 22:37

    Reply

    1) patchset 1 **DID** resolve the issue described at the related forge issue. 2) the current patchset7 does only work by coincidence. The reasons are described in the original commit-message of patchset1. 3) The "admin"-flag is completely irrelevant for resolving the forge issue.
  2. Ingo Fabbri commented on patch set 7 11/19/21, 22:40

    Reply

    4) the new commit message is misleading and describes a "wrong observation". Because the problem is not permission related.
  3. Ingo Fabbri commented on patch set 7 11/19/21, 22:47

    Reply

    5) the original patch did not make the claim to be "perfect". It was meant as a quick-fix for an issue that exist quite long already. But instead of accepting this patch to cure the symptoms fast and easy - and just make it proper in an followup-patch.
  4. Oli Bartsch commented on patch set 7 11/19/21, 22:49

    Reply

    What makes you think, the admin flag is irrelevant / it's no permission problem? Did you investigate the reason for the log message?
  5. Ingo Fabbri commented on patch set 7 11/19/21, 22:50

    Reply

    6) patchset1 can be verified working on a fresh vanilla TYPO3 master.
  6. Ingo Fabbri uploaded patch set 8 11/19/21, 23:10

  7. Ingo Fabbri updated the commit message in patch set 9 11/19/21, 23:11

  8. Ingo Fabbri commented on patch set 9 11/19/21, 23:22

    Reply

    are you kidding me? is this "versteckte kamera" or something? of course i xdebugged it all the way up the stack.
  9. core-ci voted on patch set 8 V +1 11/19/21, 23:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19582

  10. Oli Bartsch commented on patch set 9 V -1 11/19/21, 23:24

    This does not prevent the generation of sys_log entries. Assigning the current backend users' workspace id to the dummy user makes it even worse, since the assigned workspace id will mostly likely not pass the workspace access checks, because the dummy user does not have any workspace permissions set. This can only be fixed by preventing any workspace access check for the dummy user.
  11. Ingo Fabbri abandoned the change 11/19/21, 23:26

    nope. just nope.
  12. Ingo Fabbri restored the change 11/22/21, 13:03

  13. Ingo Fabbri commented on patch set 9 11/22/21, 13:09

    here we go again
  14. Ingo Fabbri updated the commit message in patch set 10 11/22/21, 13:49

  15. Ingo Fabbri uploaded patch set 11 11/22/21, 13:50

  16. Ingo Fabbri uploaded patch set 12 11/22/21, 13:52

  17. core-ci voted on patch set 11 V +1 11/22/21, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19633

  18. core-ci voted on patch set 10 V +1 11/22/21, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19632

  19. core-ci voted on patch set 12 V +1 11/22/21, 14:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19634

  20. Oli Bartsch uploaded patch set 13 11/22/21, 14:36

  21. core-ci voted on patch set 13 V +1 11/22/21, 14:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19637

  22. Jochen Roth voted on patch set 13 V +1 CR +1 11/22/21, 14:56

  23. Nikita Hovratov voted on patch set 13 V +1 CR +1 11/22/21, 16:04

  24. Oli Bartsch commented on patch set 13 V +2 CR +2 11/22/21, 16:12

    Great to have this fixed. Thanks all involved.
  25. Oli Bartsch merged patch set 14 11/22/21, 16:12