Review main Merged

72856[BUGFIX] Prevent redirects causing infinite redirect loops

Stefan Bürk CR +2 V +2 Hard +619 −0 updated 01/07/22, 12:52

Commit message

This patch adds a check to detect self referencing
redirects, thus avoiding them and instead log an error
in the corresponding frontend redirect middleware.

Furthermore, add a bunch of tests along the way to cover
this change and the different constellations, for example
not avoiding redirect with the same path but external host.

Review

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

Issues 1

Files 5

Review log 3044

Show 1219 earlier messages
  1. Stefan Bürk uploaded patch set 1 01/04/22, 15:24

  2. core-ci voted on patch set 1 V -1 01/04/22, 15:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21603

  3. Stefan Bürk uploaded patch set 2 01/04/22, 18:43

  4. Stefan Bürk updated the commit message in patch set 3 01/04/22, 18:57

  5. core-ci voted on patch set 2 V -1 01/04/22, 18:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21612

  6. Stefan Bürk uploaded patch set 4 01/04/22, 19:04

  7. Stefan Bürk updated the commit message in patch set 5 01/04/22, 19:06

  8. core-ci voted on patch set 3 V -1 01/04/22, 19:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21613

  9. core-ci voted on patch set 4 V +1 01/04/22, 19:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21614

  10. core-ci voted on patch set 5 V +1 01/04/22, 19:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21615

  11. Stefan Bürk updated the commit message in patch set 6 01/04/22, 19:23

  12. Stefan Bürk marked it ready for review 01/04/22, 19:24

  13. Stefan Bürk commented on patch set 6 01/04/22, 19:32

    Patch was added initially on 10.4. I have extended the check and added tests, directly on the main branch. Because of this, I have re-backported the already to the 10.4 branch, which needs minor adjustments. 11.5 ommited for now, should be conflict less if this main patch is accepted and merged. Eventually further changes have to be backported to 10.4 then. I would support/help the merger if needed and if changes needed.
  14. core-ci voted on patch set 6 V +1 01/04/22, 19:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21616

  15. Benni Mack voted on patch set 6 CR +1 01/05/22, 23:00

  16. Benni Mack updated the commit message in patch set 7 01/05/22, 23:01

  17. Benni Mack commented on patch set 7 01/05/22, 23:01

    RedirectHandler.php:70

    wouldn't this be as severe as an error rather than a warning?
  18. core-ci voted on patch set 7 V +1 01/05/22, 23:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21676

  19. Stefan Bürk uploaded patch set 8 01/05/22, 23:39

  1. Stefan Bürk commented on patch set 8 01/05/22, 23:43

    RedirectHandler.php:70 Reply

    Ack. Done.
  2. core-ci voted on patch set 8 V -1 01/05/22, 23:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21677

  3. Oli Bartsch rebased onto patch set 9 01/06/22, 00:29

  4. Stefan Bürk uploaded patch set 10 01/06/22, 00:30

  5. core-ci voted on patch set 10 V +1 01/06/22, 00:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21681

  6. core-ci voted on patch set 9 V +1 01/06/22, 00:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21680

  7. Benni Mack voted on patch set 10 V +1 CR +1 01/06/22, 09:08

  8. Nikita Hovratov uploaded patch set 11 01/06/22, 14:09

  9. Nikita Hovratov commented on patch set 11 V +1 CR +1 01/06/22, 14:12

    My changes: - Commit message: Fixed sentence. - Cast UriInterfaces to string, as this won't happen when converting to json. - Add path directly to log message for quick overview. - Clean up empty comment in tests
  10. core-ci voted on patch set 11 V +1 01/06/22, 14:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21703

  11. Stefan Bürk commented on patch set 11 CR -1 01/06/22, 14:55

    need to recheck another point, thus temp -1
  12. Stefan Bürk uploaded patch set 12 01/06/22, 22:14

  13. core-ci voted on patch set 12 V +1 01/06/22, 22:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21741

  14. Stefan Bürk commented on patch set 12 01/06/22, 22:44

    Further changes done (Thanks to Oliver Bartsch for pinging in slack noting these): - add uri sanitizing to handle sanitizing for absolute and relative comparison - add default port sanitizing into account - add sanitizing of userinfo (user + password) - add sanitizing of fragment - streamline check method - Log a slighty other error message if target uri had a fragment part - added more tests to cover these cases Notice for merger/backporting: - 10.4 backport updated with latest patchset (main#12 => 10.4#5) from this main branch patch with needed backport-adjustments - 11.5 still left out, should be conflict less to backport if this main-patch is merged/ready-to-merge
  15. Stefan Bürk uploaded patch set 13 01/07/22, 10:15

  16. Stefan Bürk commented on patch set 13 01/07/22, 10:21

    Minor code-cleanup: avoid yoda-style Also updated backport: Patchset 13 (main) ==> Patchset 6 (10.4)
  17. core-ci voted on patch set 13 V +1 01/07/22, 10:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21756

  18. Nikita Hovratov voted on patch set 13 V +1 CR +1 01/07/22, 11:05

  19. Oli Bartsch uploaded patch set 14 01/07/22, 11:06

  20. Oli Bartsch voted on patch set 14 V +1 CR +1 01/07/22, 11:06

  21. Nikita Hovratov voted on patch set 14 V +1 CR +1 01/07/22, 11:16

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

  23. Stefan Bürk commented on patch set 14 01/07/22, 12:06

    Re-backported patchset 14 to 10.4 backport patch (patchset 7)
  24. Benni Mack voted on patch set 14 V +2 CR +2 01/07/22, 12:52

  25. Benni Mack merged patch set 15 01/07/22, 12:52