Review 10.4 Merged

72808[BUGFIX] Prevent redirects causing infinite redirect loops

Jörn Wagner CR +2 V +2 Hard +620 −1 updated 01/07/22, 21:40

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
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 2229

Show 34 earlier messages
  1. Jörn Wagner uploaded patch set 1 12/28/21, 14:57

  2. core-ci voted on patch set 1 V +1 12/28/21, 15:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21481

  3. Benni Mack commented on patch set 1 12/29/21, 20:28

    Should we also add this to v11.5?
  4. Jörn Wagner commented on patch set 1 12/30/21, 08:19

    Reply

    Yes, please! :-)
  1. Benni Mack updated the commit message in patch set 2 12/30/21, 09:25

  2. core-ci voted on patch set 2 V +1 12/30/21, 09:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21510

  3. Jörn Wagner commented on patch set 2 12/30/21, 09:36

    Reply

    Done
  4. Stefan Bürk commented on patch set 2 CR -1 12/30/21, 13:09

    RedirectHandler.php:84

    This check would prevent redirects to another domain with the same path, either local domain of another site config or even an external redirect if the path "would be the same": ``` current.domain.tld/some-path -> non-instance.domain.tld/some-path ``` This solution is not usable and could be a regression.
  5. Stefan Bürk commented on patch set 2 01/03/22, 17:29

    anyway, patch is noted for main, 11.5 and 10.4, but done on 10.4 branch. Will pick-up this patch the comming days, do it from main and add a proper check as noted/commented by me already.
  6. Stefan Bürk commented on patch set 2 01/04/22, 15:25

    Working on it on main with adding tests: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
  7. Stefan Bürk uploaded patch set 3 01/04/22, 19:25

  8. Stefan Bürk commented on patch set 3 CR -1 01/04/22, 19:29

    Temporarly -1: main patch should be reviewed and merged first. I have extended the check and added some tests to cover this. Added tests already shows why the check had to be changed as noted in one of my comments. I decided to update this patch on 10.4 with the (backported) changes already to be align with the main patch for now. Eventually notes/changes from the main patch has to be updated here too. 11.5 backport omitted for now, which should be an easy one if main patch is accepted and merged for the merger.

    RedirectHandler.php:84 Reply

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

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

  11. Stefan Bürk voted on patch set 4 CR -1 01/06/22, 00:36

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

  13. Stefan Bürk uploaded patch set 5 01/06/22, 22:40

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

    Updated this backport to latest changes from extended/updated main patch. (main patchset #12)
  15. core-ci voted on patch set 5 V +1 01/06/22, 22:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21742

  16. Stefan Bürk uploaded patch set 6 01/07/22, 10:20

  17. Stefan Bürk commented on patch set 6 CR -1 01/07/22, 10:24

    Updatet with main patchset #13 ( Minor code change )
  18. core-ci voted on patch set 6 V +1 01/07/22, 10:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21757

  19. Stefan Bürk uploaded patch set 7 01/07/22, 12:04

  20. Stefan Bürk commented on patch set 7 CR -1 01/07/22, 12:05

    Updated with patchset 14 of main patch. -1 still until main patch is merged.
  21. core-ci voted on patch set 7 V +1 01/07/22, 12:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21763

  22. Stefan Bürk wrote 01/07/22, 13:02

    Removed Code-Review-1 by Stefan Bürk <stefan@buerk.tech>
  23. Stefan Bürk voted on patch set 7 V +1 CR +1 01/07/22, 13:09

  24. Benni Mack voted on patch set 7 V +2 CR +2 01/07/22, 21:40

  25. Benni Mack merged patch set 8 01/07/22, 21:40