Skip to content

Commit

Permalink
Restrict redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
collectiveaccess committed Nov 21, 2021
1 parent 655fd24 commit 3e429d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/system/AuthController.php
Expand Up @@ -218,6 +218,7 @@ private function _getRedirectUrl() {
$host = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
$redirect_url = $this->request->getParameter('redirect', pString, null, ['forcePurify' => true]) ?: caNavUrl($this->request, null, null, null);

$redirect_url = preg_replace("![^A-Za-z0-9/:\?\._\*\+\-]+.*!", '', $redirect_url);
if(!preg_match('!^'.preg_quote($host, '!').'!', $redirect_url)) {
$redirect_url = null;
}
Expand Down

0 comments on commit 3e429d2

Please sign in to comment.