Review main Merged

84432[BUGFIX] Properly redirect secondary backend module routes

Daniel Siepmann CR +2 V +2 Easy +7 −5 updated 08/30/24, 08:52

Commit message

Users might open URLs to backend modules.
Those are checked for existence and permissions. But the permission
check used the route identifier as module identifier.

This is now fixed by resolving the route identifier to module identifier
which is then used for permission checks.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1417

  1. Daniel Siepmann uploaded patch set 1 05/28/24, 05:37

  2. core-ci voted on patch set 1 V +1 05/28/24, 05:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58377

  3. Oliver Klee commented on patch set 1 05/28/24, 08:52

    Can we cover this with a test?
  4. Oliver Klee wrote 08/25/24, 10:11

    Removed cc Oliver Klee.
  5. Benjamin Franzke uploaded patch set 2 V +1 08/27/24, 07:32

  6. Benjamin Franzke commented on patch set 2 08/27/24, 07:32

    Reply

    not right now.
  7. core-ci voted on patch set 2 V +1 08/27/24, 07:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64276

  8. Oli Bartsch commented on patch set 2 CR -1 08/28/24, 13:40

    BackendController.php:286

    Do we need to use the module identifier here and in line 289 as well?
  9. Benjamin Franzke commented on patch set 2 08/29/24, 06:51

    BackendController.php:286 Reply

    Hm, in theory yes, but I'm unable to actually trigger this codepath, because `BackendModuleValidator::validateModuleAccess` is also/already checking that and creating a redirect early on. Kinda looks like dead code. Do you know how to trigger this? (we should change it anyway, but I'd feel more confident with backporting, if we could actually test this)
  10. Benjamin Franzke uploaded patch set 3 CR +1 V +1 08/29/24, 07:00

  11. Benjamin Franzke commented on patch set 3 08/29/24, 07:00

    BackendController.php:286 Reply

    I'm pretty sure this has been broken all the time, because the redirect message in actually wrong (arguments have been swapped) if created by the backend controller. (I could only verifiy that by disabling the backend module validator middleware – so I still think that this is dead code that should be removed at least in v13)
  12. Benjamin Franzke commented on patch set 3 08/29/24, 07:01

    BackendController.php:333

    I've fixed this as a drive-by, since otherwise the changes in line 289 are not properly testable (and this can only be triggered by deactivating the validation in the BackendModuleValidator middleware)
  13. core-ci voted on patch set 3 V +1 08/29/24, 07:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64457

  14. Benjamin Franzke commented on patch set 3 08/29/24, 08:28

    BackendController.php:286 Reply

    Done
  15. Benni Mack voted on patch set 3 CR +1 V +1 08/29/24, 19:53

  16. Benjamin Franzke voted on patch set 3 CR +2 V +2 08/30/24, 08:28

  17. Benjamin Franzke merged patch set 4 08/30/24, 08:52