-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix login/logout redirect vulnerability
- Loading branch information
1 parent
db5b39d
commit d1a6b3f
Showing
2 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ public function logoutAction() | |
$redirect = $this->params()->fromPost('redirect', $this->params()->fromQuery('redirect', false)); | ||
|
||
if ($this->getOptions()->getUseRedirectParameterIfPresent() && $redirect) { | ||
return $this->redirect()->toUrl($redirect); | ||
return $this->redirect()->toRoute($redirect); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Ocramius
Contributor
|
||
} | ||
|
||
return $this->redirect()->toRoute($this->getOptions()->getLogoutRedirectRoute()); | ||
|
@@ -155,7 +155,7 @@ public function authenticateAction() | |
} | ||
|
||
if ($this->getOptions()->getUseRedirectParameterIfPresent() && $redirect) { | ||
return $this->redirect()->toUrl($redirect); | ||
return $this->redirect()->toRoute($redirect); | ||
} | ||
|
||
return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What happens if the route I need to redirect to requires extra parameters (e.g. segment route). How would that be specified in the query string? This was developed by myself explicitly to have the URL as the redirect route. I have a requirement to redirect someone to a specific page in a checkout process (/checkout/customer) and the route only specifies /checkout[/:step]. How do I redirect to that with only the route name and no params?