Skip to content

Commit

Permalink
Use trim and rawurlencode to prevent possible infinite loop. (#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
khalima authored Dec 10, 2024
1 parent 6d6f508 commit fef6f63
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function needsRedirectToLogin(RequestEvent $event): bool {
return FALSE;
}
$requestUri = $event->getRequest()->getRequestUri();
$urlObject = Url::fromUserInput($requestUri);
$urlObject = Url::fromUserInput(trim(rawurldecode($requestUri)));
if ($urlObject->access(User::getAnonymousUser()) === FALSE) {
return TRUE;
}
Expand Down Expand Up @@ -107,7 +107,8 @@ public function needsRedirectToMandate(RequestEvent $event): bool {
if ($selectedCompany !== NULL) {
return FALSE;
}
$urlObject = Url::fromUserInput($event->getRequest()->getRequestUri());
$requestUri = $event->getRequest()->getRequestUri();
$urlObject = Url::fromUserInput(trim(rawurldecode($requestUri)));
$routeName = $urlObject->getRouteName();

$nodeType = '';
Expand Down

0 comments on commit fef6f63

Please sign in to comment.