From e8c5cab3c117e68a0d837319e0e83bdfc50be1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 18 Jul 2016 16:39:25 +0200 Subject: [PATCH] Improve URL filtering in url.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/core.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index b8eae4d070..19b4383c89 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -818,6 +818,10 @@ if(! function_exists('hash_equals')) { function PMA_isAllowedDomain($url) { $arr = parse_url($url); + // Avoid URLs without hostname or with credentials + if (empty($arr['host']) || ! empty($arr['user']) || ! empty($arr['pass'])) { + return false; + } $domain = $arr["host"]; $domainWhiteList = array( /* Include current domain */