protection against XSS when register_globals is on and .htaccess has no effect

This commit is contained in:
Marc Delisle
2008-06-21 15:01:27 +00:00
parent b031606c08
commit afbb2a9dc2
73 changed files with 221 additions and 7 deletions

View File

@@ -89,6 +89,8 @@ danbarry
- bug #1981043 [export] HTML in exports getting corrupted,
thanks to Jason Judge - jasonjudge
- bug #1936761 [interface] BINARY not treated as BLOB: update/delete issues
- protection against XSS when register_globals is on and .htaccess has
no effect, thanks to Tim Starling
- bug #1996943 [export] Firefox 3 and .sql.gz (corrupted); detect Gecko 1.9,
thanks to Jürgen Wind - windkiel

View File

@@ -8,8 +8,8 @@
* @version $Id$
*/
if (! defined('PMA_COMING_FROM_COMMON')) {
exit;
if (! defined('PHPMYADMIN')) {
exit;
}
require './libraries/auth/swekey/swekey.auth.lib.php';

View File

@@ -5,7 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Loads the recode or iconv extensions if any of it is not loaded yet

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -54,6 +54,11 @@ if (version_compare(phpversion(), '6', 'lt')) {
@ini_set('magic_quotes_runtime', false);
}
/**
* for verification in all procedural scripts under libraries
*/
define('PHPMYADMIN', true);
/**
* core functions
*/
@@ -781,9 +786,6 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// Gets the authentication library that fits the $cfg['Server'] settings
// and run authentication
// (for a quick check of path disclosure in auth/cookies:)
define('PMA_COMING_FROM_COMMON', true);
// to allow HTTP or http
$cfg['Server']['auth_type'] = strtolower($cfg['Server']['auth_type']);
if (! file_exists('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php')) {

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Gets some core libraries

View File

@@ -4,6 +4,10 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
$url_query .= '&goto=db_structure.php';
$events = PMA_DBI_fetch_result('SELECT EVENT_NAME, EVENT_TYPE FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');

View File

@@ -33,6 +33,9 @@
* @uses addslashes()
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* requirements

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -14,6 +14,10 @@
* Also, support DEFINER (like we do in export).
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
$url_query .= '&goto=db_structure.php';
$routines = PMA_DBI_fetch_result('SELECT SPECIFIC_NAME,ROUTINE_NAME,ROUTINE_TYPE,DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');

View File

@@ -6,6 +6,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -3,6 +3,9 @@
/**
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* checks for DBG extension and trys to load if not loaded

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* MySQL client API

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
// MySQL client API
if (!defined('PMA_MYSQL_CLIENT_API')) {

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
// loic1: autocomplete feature of IE kills the "onchange" event handler and it
// must be replaced by the "onpropertychange" one in this case

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -24,6 +24,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Sorts available languages by their true english names

View File

@@ -9,6 +9,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
// this gets executed twice so avoid a notice
if (! defined('CG_FORMAT_NHIBERNATE_CS')) {

View File

@@ -3,6 +3,9 @@
/**
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Set of functions used to build CSV dumps of tables

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -3,6 +3,9 @@
/**
* Sample export to Texy! text.
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -43,6 +43,9 @@
* @uses file_exists()
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* for PMA_setHistory()

View File

@@ -8,6 +8,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* copy values from one array to another, usally from a superglobal into $GLOBALS

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Gets a core script and starts output buffering work

View File

@@ -4,6 +4,9 @@
*
* @version $Id: header.inc.php 10719 2007-10-04 15:03:44Z cybot_tm $
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* We need to know something about user

View File

@@ -6,6 +6,9 @@
* @todo add an option for handling NULL values
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam();

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -11,6 +11,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Gets the php internal encoding codes and sets the available encoding

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Prepares the work and runs some other scripts if required

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -5,6 +5,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* tries to find the language to use

View File

@@ -9,6 +9,9 @@
* @uses $userlink
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Gets some core libraries

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Check parameters

View File

@@ -11,6 +11,9 @@
* @uses session_start()
* @uses ini_set()
*/
if (! defined('PHPMYADMIN')) {
exit;
}
// verify if PHP supports session, die if it does not

View File

@@ -10,6 +10,9 @@
* @usedby tbl_structure.php
* @usedby querywindow.php
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -21,6 +21,9 @@
*
* @version$Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* @global array MySQL function names

View File

@@ -29,7 +29,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Minimum inclusion? (i.e. for the stylesheet builder)

View File

@@ -27,6 +27,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
@include_once 'SOAP/Client.php';

View File

@@ -29,6 +29,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* We need the PEAR libraries, so do a minimum version check first

View File

@@ -21,6 +21,9 @@
* @uses defined()
* @todo a .lib filename should not have code in main(), split or rename file
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/* Try to load mbstring */
if (!@extension_loaded('mbstring')) {

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Gets some core libraries

View File

@@ -8,6 +8,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
*

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Check parameters

View File

@@ -6,6 +6,9 @@
* included by tbl_addfield.php, -_alter.php, -_create.php
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Check parameters

View File

@@ -29,6 +29,9 @@
* @uses PMA_NO_VARIABLES_IMPORT
* @uses PMA_sqlAddslashes()
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* do not import request variable into global scope

View File

@@ -4,6 +4,9 @@
*
* @version $Id$
*/
if (! defined('PHPMYADMIN')) {
exit;
}
$url_query .= '&goto=tbl_structure.php';