diff --git a/htdocs/core/modules/openid_connect/callback.php b/htdocs/core/modules/openid_connect/callback.php index 065e6801588..ca973b03d28 100644 --- a/htdocs/core/modules/openid_connect/callback.php +++ b/htdocs/core/modules/openid_connect/callback.php @@ -46,7 +46,8 @@ top_htmlhead('', '', 0, 0, $arrayofjs); $prefix = dol_getprefix(''); $callbackUrl = $_COOKIE["DOL_rollback_url_".$prefix]; // Was set by login page to $_SERVER['REQUEST_URI'] to allow come back to initial requested page -if (empty($callbackUrl) || !preg_match('/^\//', $callbackUrl)) { + +if (empty($callbackUrl) || !preg_match('/^\/[a-z0-9]/i', $callbackUrl)) { // We accept only value that is an internal relative URL. URL starting with http are not allowed. $callbackUrl = '/'; } @@ -57,7 +58,7 @@ if ($callbackUrl === '/') { } ?> -
+