[Pkg-owncloud-commits] [owncloud] 186/258: Redirect only to absolute URL

David Prévot taffit at moszumanska.debian.org
Sat Oct 11 17:22:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 0484939fe0ae61a6c50abc07533d8d36c590b7c2
Author: Lukas Reschke <lukas at owncloud.com>
Date:   Mon Sep 29 17:07:43 2014 +0200

    Redirect only to absolute URL
    
    We do not want to redirect to other domains using the "?redirect_url=" feature. Please notice, that the ownCloud project does not consider open redirectors as security issue.
---
 lib/private/util.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/private/util.php b/lib/private/util.php
index ceb55bb..e4a952d 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -841,8 +841,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 at 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list