1
0
miroir de https://github.com/nextcloud/server.git synchronisé 2024-07-25 05:44:55 +02:00

Disallow URLs containing a @

Cette révision appartient à :
Lukas Reschke 2013-04-23 00:26:40 +03:00
Parent 4af4a5bd98
révision 6e78c4fcc0

Voir le fichier

@ -631,8 +631,13 @@ class OC {
// Handle redirect URL for logged in users
if (isset($_REQUEST['redirect_url']) && OC_User::isLoggedIn()) {
$location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
header('Location: ' . $location);
return;
// Deny the redirect if the URL contains a @
// This prevents unvalidated redirects like ?redirect_url=:user@domain.com
if (strpos($location, '@') === FALSE) {
header('Location: ' . $location);
return;
}
}
// Handle WebDAV
if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {