Issue Feature Rejected

#99311Add a redirect option in FrontendUserAuthenticator Middleware

Aristeidis Karavas 12/08/22, 09:47 updated 04/11/25, 10:37

Description

Using a custom oAuth2 Login, i tried to create a login via Discord. I set the logintype, then i created my Authentication Service, everything worked great. What i missed though is the redirect option. Once the TYPO3\CMS\Frontend\Middleware\FrontendUserAuthenticator kicks in and once the login is successful, the middleware just returns the response, without the option to redirect somewhere.

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php#L91

What i am thinking of as an MVP, is maybe a redirect GET parameter which is going to be validated just before the returned response. If it is there, then return the response with an extra Location: header. Maybe something like that:


if (count($request->getQueryParams()) > 0 && array_key_exists('redirect', $request->getQueryParams()))
   $response = $this->responseFactory->createResponse()
         ->withHeader('Location', $request->getQueryParams()['redirect']);
    return $response;
}

After the MVP, i am thinking of maybe a redirect which is generated via a pid. Instead of passing a whole URL in the redirect parameter, maybe a PID could be passed and then the Middleware could resolve this pid.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 6

  1. Markus Klein commented <span data-processor="relativetime" data-value="2024-12-11T16:42:35+00:00" > 12/11/24, 16:42 </span>

    If you are using OpenID Connect, consider using https://extensions.typo3.org/extension/oidc (latest master version on github)

  2. Benni Mack commented and changed status New Rejected <span data-processor="relativetime" data-value="2025-04-11T10:37:35+00:00" > 04/11/25, 10:37 </span>

    Hey,

    I will close this. If this is implemented in Core, we need to harden this. The solution from you is an effective “Open Redirect” Vulnerability https://cwe.mitre.org/data/definitions/601.html – This should not be shipped in Core.