mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02: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();
|
||||
}
|
||||
|
||||
$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(
|
||||
isset($_REQUEST['BackURL'])
|
||||
&& $_REQUEST['BackURL']
|
||||
&& (
|
||||
// absolute redirection URLs may cause spoofing
|
||||
!Director::is_absolute_url($_REQUEST['BackURL'])
|
||||
// absolute URLs on the current domain are allowed
|
||||
|| strpos($_REQUEST['BackURL'], Director::absoluteBaseURL()) !== FALSE
|
||||
)
|
||||
// absolute redirection URLs may cause spoofing
|
||||
&& Director::is_site_url($_REQUEST['BackURL'])
|
||||
) {
|
||||
Director::redirect($_REQUEST['BackURL']);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user