[BUGFIX] Prevent redirects causing infinite redirect loops
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. Resolves: #96427 Releases: main, 11.5, 10.4 Change-Id: I554ba51b53065dd754068e379f69c2a5dffc3054 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808 Tested-by:core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/redirects/Classes/Http/Middleware/RedirectHandler.php 77 additions, 1 deletion...ext/redirects/Classes/Http/Middleware/RedirectHandler.php
- typo3/sysext/redirects/Tests/Functional/Service/Fixtures/RedirectService_samePathRedirectsWithExternalTarget.csv 27 additions, 0 deletions...s/RedirectService_samePathRedirectsWithExternalTarget.csv
- typo3/sysext/redirects/Tests/Functional/Service/Fixtures/RedirectService_samePathWithSameDomainAndRelativeTarget.csv 23 additions, 0 deletions...directService_samePathWithSameDomainAndRelativeTarget.csv
- typo3/sysext/redirects/Tests/Functional/Service/Fixtures/RedirectService_samePathWithSameDomainT3Target.csv 23 additions, 0 deletions...xtures/RedirectService_samePathWithSameDomainT3Target.csv
- typo3/sysext/redirects/Tests/Functional/Service/RedirectServiceTest.php 470 additions, 0 deletions...edirects/Tests/Functional/Service/RedirectServiceTest.php
Please register or sign in to comment