summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-01 12:47:43 +0200
committerLukas Reschke <lukas@owncloud.com>2014-10-01 12:47:43 +0200
commite762ff2bbdc4eefd6aefab1950f7da83f2c6735d (patch)
treec7379abc7a6efd765bad56520ec89a317a71d83d /lib
parente93f98f1de772ae363e4e5c839f5a8e957c113e9 (diff)
parent6e7365fc1725fdb6868398ebb821aa44a09fb903 (diff)
downloadnextcloud-server-e762ff2bbdc4eefd6aefab1950f7da83f2c6735d.tar.gz
nextcloud-server-e762ff2bbdc4eefd6aefab1950f7da83f2c6735d.zip
Merge pull request #11356 from owncloud/redirect-only-to-the-same-domain
Redirect only to absolute URL
Diffstat (limited to 'lib')
-rwxr-xr-xlib/private/util.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 5097174ac11..304db827a1a 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -847,8 +847,10 @@ class OC_Util {
*/
public static function getDefaultPageUrl() {
$urlGenerator = \OC::$server->getURLGenerator();
- if (isset($_REQUEST['redirect_url'])) {
- $location = urldecode($_REQUEST['redirect_url']);
+ // Deny the redirect if the URL contains a @
+ // This prevents unvalidated redirects like ?redirect_url=:user@domain.com
+ if (isset($_REQUEST['redirect_url']) && strpos($_REQUEST['redirect_url'], '@') === false) {
+ $location = $urlGenerator->getAbsoluteURL(urldecode($_REQUEST['redirect_url']));
} else {
$defaultPage = OC_Appconfig::getValue('core', 'defaultpage');
if ($defaultPage) {