diff --git a/ChangeLog b/ChangeLog index 45e274bf3..e3add30bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -131,6 +131,7 @@ - [export] Better handling of export to PHP array. - rfe #3158867 [privileges] No DROP DATABASE warning if you delete a user - [interface] Add link to documentation for status variables. +- [security] Redirect external links to avoid Referer leakage. 3.3.10.0 (not yet released) - patch #3147400 [structure] Aria table size printed as unknown, diff --git a/libraries/Message.class.php b/libraries/Message.class.php index 8783cdb97..1248acd61 100644 --- a/libraries/Message.class.php +++ b/libraries/Message.class.php @@ -702,7 +702,11 @@ class PMA_Message } } - $message = preg_replace($pattern, '', $message); + if (substr($found[1], 0, 4) == 'http') { + $message = preg_replace($pattern, '', $message); + } else { + $message = preg_replace($pattern, '', $message); + } } return $message; diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 21ca47a61..805f9b304 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -192,7 +192,7 @@ if (top != self) { ?>
-'; + return ''; } elseif ($big_icon) { - return '' . __('Documentation') . ''; + return '' . __('Documentation') . ''; } elseif ($GLOBALS['cfg']['ReplaceHelpImg']) { - return '' . __('Documentation') . ''; + return '' . __('Documentation') . ''; } else { - return '[' . __('Documentation') . ']'; + return '[' . __('Documentation') . ']'; } } // end of the 'PMA_showMySQLDocu()' function @@ -2425,7 +2425,7 @@ function PMA_getDbLink($database = null) function PMA_externalBug($functionality, $component, $minimum_version, $bugref) { if ($component == 'mysql' && PMA_MYSQL_INT_VERSION < $minimum_version) { - echo PMA_showHint(sprintf(__('The %s functionality is affected by a known bug, see %s'), $functionality, 'http://bugs.mysql.com/' . $bugref)); + echo PMA_showHint(sprintf(__('The %s functionality is affected by a known bug, see %s'), $functionality, './url.php?url=http://bugs.mysql.com/' . $bugref)); } } diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index e3b10dc1c..b07ac3a1e 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -681,7 +681,7 @@ class FormDisplay if ($test == 'Export') { $opt_name = substr($opt_name, 7); } - return 'http://wiki.phpmyadmin.net/pma/Config#' . $opt_name; + return './url.php?url=http://wiki.phpmyadmin.net/pma/Config#' . $opt_name; } /** @@ -774,4 +774,4 @@ class FormDisplay } } } -?> \ No newline at end of file +?> diff --git a/libraries/config/config_functions.lib.php b/libraries/config/config_functions.lib.php index 6f9aabb34..0d26cb562 100644 --- a/libraries/config/config_functions.lib.php +++ b/libraries/config/config_functions.lib.php @@ -91,10 +91,14 @@ function PMA_lang_link_replace($link, $text) $separator = PMA_get_arg_separator('html'); } - if (!preg_match('#^http://#', $link)) { + if (!preg_match('#^https?://#', $link)) { $link = str_replace('&', $separator, $link); + } elseif (defined('PMA_SETUP')) { + $link = '../url.php?url=' . $link; + } else { + $link = './url.php?url=' . $link; } return '' . $text . ''; } -?> \ No newline at end of file +?> diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 202cd4d72..fc2065f3b 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -235,7 +235,7 @@ if(isset($_GET['sql_query'])) { } $message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is. See the %4$sFAQ%5$s for details.')); - $message->addParam('', false); $message->addParam('', false); $message->addParam($trans); diff --git a/libraries/engines/pbms.lib.php b/libraries/engines/pbms.lib.php index 58e31592b..4065bf309 100644 --- a/libraries/engines/pbms.lib.php +++ b/libraries/engines/pbms.lib.php @@ -91,15 +91,15 @@ class PMA_StorageEngine_pbms extends PMA_StorageEngine function getPageDocumentation() { $output = '

Documentation and further information about PBMS can be found on ' . "\n" - . 'The PrimeBase Media Streaming home page.

' . "\n" + . 'The PrimeBase Media Streaming home page.

' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" diff --git a/libraries/engines/pbxt.lib.php b/libraries/engines/pbxt.lib.php index fbc6ce68a..66da56ad0 100644 --- a/libraries/engines/pbxt.lib.php +++ b/libraries/engines/pbxt.lib.php @@ -122,15 +122,15 @@ class PMA_StorageEngine_pbxt extends PMA_StorageEngine function getPageDocumentation() { $output = '

Documentation and further information about PBXT can be found on the ' . "\n" - . 'PrimeBase XT Home Page.

' . "\n" + . 'PrimeBase XT Home Page.

' . "\n" . '

' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" diff --git a/main.php b/main.php index 48e98fc4c..3d0323482 100644 --- a/main.php +++ b/main.php @@ -210,16 +210,16 @@ echo '

phpMyAdmin

'; echo '