mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Checking for Director::is_site_url() before redirecting in Controller->redirectBack() and MemberLoginForm
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73252 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ad3d9ae29a
commit
a96ca0eacc
@ -480,7 +480,13 @@ class Controller extends RequestHandler {
|
|||||||
$url = Director::baseURL();
|
$url = Director::baseURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->redirect($url);
|
// absolute redirection URLs not located on this site may cause phishing
|
||||||
|
if(Director::is_site_url($url)) {
|
||||||
|
return $this->redirect($url);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,12 +126,8 @@ JS
|
|||||||
} elseif(
|
} elseif(
|
||||||
isset($_REQUEST['BackURL'])
|
isset($_REQUEST['BackURL'])
|
||||||
&& $_REQUEST['BackURL']
|
&& $_REQUEST['BackURL']
|
||||||
&& (
|
|
||||||
// absolute redirection URLs may cause spoofing
|
// absolute redirection URLs may cause spoofing
|
||||||
!Director::is_absolute_url($_REQUEST['BackURL'])
|
&& Director::is_site_url($_REQUEST['BackURL'])
|
||||||
// absolute URLs on the current domain are allowed
|
|
||||||
|| strpos($_REQUEST['BackURL'], Director::absoluteBaseURL()) !== FALSE
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
Director::redirect($_REQUEST['BackURL']);
|
Director::redirect($_REQUEST['BackURL']);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user