Skip to content
Extraits de code Groupes Projets
Valider 04cdd87f rédigé par fil@rezo.net's avatar fil@rezo.net
Parcourir les fichiers
report de https://core.spip.net/projects/spip/repository/revisions/22930 ; laisser passer facebook (+ soucis avec les accents dans ce fichier)
parent 47a4c79c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* ------------------ * ------------------
*/ */
define('_ECRAN_SECURITE', '1.2.4'); // 2016-03-10 define('_ECRAN_SECURITE', '1.2.5'); // 2016-03-13
/* /*
* Documentation : http://www.spip.net/fr_article4200.html * Documentation : http://www.spip.net/fr_article4200.html
...@@ -27,7 +27,7 @@ if (!defined('_IS_BOT') and isset($_GET['var_isbot'])) ...@@ -27,7 +27,7 @@ if (!defined('_IS_BOT') and isset($_GET['var_isbot']))
define('_IS_BOT',$_GET['var_isbot']?true:false); define('_IS_BOT',$_GET['var_isbot']?true:false);
/* /*
* Dtecteur de robot d'indexation * Détecteur de robot d'indexation
*/ */
if (!defined('_IS_BOT')) if (!defined('_IS_BOT'))
define('_IS_BOT', define('_IS_BOT',
...@@ -38,15 +38,15 @@ if (!defined('_IS_BOT')) ...@@ -38,15 +38,15 @@ if (!defined('_IS_BOT'))
// MSIE 6.0 est un botnet 99,9% du temps, on traite donc ce USER_AGENT comme un bot // MSIE 6.0 est un botnet 99,9% du temps, on traite donc ce USER_AGENT comme un bot
. 'MSIE 6\.0|' . 'MSIE 6\.0|'
// UA plus cibles // UA plus cibles
. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti' . '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
. ',i', (string) $_SERVER['HTTP_USER_AGENT']) . ',i', (string) $_SERVER['HTTP_USER_AGENT'])
); );
/* /*
* Interdit de passer une variable id_article (ou id_xxx) qui ne * Interdit de passer une variable id_article (ou id_xxx) qui ne
* soit pas numrique (ce qui bloque l'exploitation de divers trous * soit pas numérique (ce qui bloque l'exploitation de divers trous
* de scurit, dont celui de toutes les versions < 1.8.2f) * de sécurité, dont celui de toutes les versions < 1.8.2f)
* (sauf pour id_table, qui n'est pas numrique jusqu' [5743]) * (sauf pour id_table, qui n'est pas numérique jusqu'à [5743])
* (id_base est une variable de la config des widgets de WordPress) * (id_base est une variable de la config des widgets de WordPress)
*/ */
foreach ($_GET as $var => $val) foreach ($_GET as $var => $val)
...@@ -63,13 +63,13 @@ foreach ($GLOBALS as $var => $val) ...@@ -63,13 +63,13 @@ foreach ($GLOBALS as $var => $val)
$GLOBALS[$var] = is_array($GLOBALS[$var])?@array_map('intval', $GLOBALS[$var]):intval($GLOBALS[$var]); $GLOBALS[$var] = is_array($GLOBALS[$var])?@array_map('intval', $GLOBALS[$var]):intval($GLOBALS[$var]);
/* /*
* Interdit la variable $cjpeg_command, qui tait utilise sans * Interdit la variable $cjpeg_command, qui était utilisée sans
* prcaution dans certaines versions de dev (1.8b2 -> 1.8b5) * précaution dans certaines versions de dev (1.8b2 -> 1.8b5)
*/ */
$cjpeg_command = ''; $cjpeg_command = '';
/* /*
* Contrle de quelques variables (XSS) * Contrôle de quelques variables (XSS)
*/ */
foreach(array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax_ancre') as $var) { foreach(array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax_ancre') as $var) {
if (isset($_GET[$var])) if (isset($_GET[$var]))
...@@ -79,7 +79,7 @@ foreach(array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax ...@@ -79,7 +79,7 @@ foreach(array('lang', 'var_recherche', 'aide', 'var_lang_r', 'lang_r', 'var_ajax
} }
/* /*
* Filtre l'accs spip_acces_doc (injection SQL en 1.8.2x) * Filtre l'accès à spip_acces_doc (injection SQL en 1.8.2x)
*/ */
if (preg_match(',^(.*/)?spip_acces_doc\.,', (string)$_SERVER['REQUEST_URI'])) { if (preg_match(',^(.*/)?spip_acces_doc\.,', (string)$_SERVER['REQUEST_URI'])) {
$file = addslashes((string)$_GET['file']); $file = addslashes((string)$_GET['file']);
...@@ -94,7 +94,7 @@ and $_REQUEST['page'] == "identifiants") ...@@ -94,7 +94,7 @@ and $_REQUEST['page'] == "identifiants")
$ecran_securite_raison = "identifiants"; $ecran_securite_raison = "identifiants";
/* /*
* Agenda joue l'injection php * Agenda joue à l'injection php
*/ */
if (isset($_REQUEST['partie_cal']) if (isset($_REQUEST['partie_cal'])
and $_REQUEST['partie_cal'] !== htmlentities((string)$_REQUEST['partie_cal'])) and $_REQUEST['partie_cal'] !== htmlentities((string)$_REQUEST['partie_cal']))
...@@ -104,7 +104,7 @@ and $_REQUEST['echelle'] !== htmlentities((string)$_REQUEST['echelle'])) ...@@ -104,7 +104,7 @@ and $_REQUEST['echelle'] !== htmlentities((string)$_REQUEST['echelle']))
$ecran_securite_raison = "echelle"; $ecran_securite_raison = "echelle";
/* /*
* Espace priv * Espace privé
*/ */
if (isset($_REQUEST['exec']) if (isset($_REQUEST['exec'])
and !preg_match(',^[\w-]+$,', (string)$_REQUEST['exec'])) and !preg_match(',^[\w-]+$,', (string)$_REQUEST['exec']))
...@@ -134,7 +134,7 @@ and $_REQUEST['action'] == 'configurer') { ...@@ -134,7 +134,7 @@ and $_REQUEST['action'] == 'configurer') {
} }
/* /*
* Bloque les requtes contenant %00 (manipulation d'include) * Bloque les requêtes contenant %00 (manipulation d'include)
*/ */
if (strpos( if (strpos(
@get_magic_quotes_gpc() ? @get_magic_quotes_gpc() ?
...@@ -144,22 +144,22 @@ if (strpos( ...@@ -144,22 +144,22 @@ if (strpos(
$ecran_securite_raison = "%00"; $ecran_securite_raison = "%00";
/* /*
* Bloque les requtes fond=formulaire_ * Bloque les requêtes fond=formulaire_
*/ */
if (isset($_REQUEST['fond']) if (isset($_REQUEST['fond'])
and preg_match(',^formulaire_,i', $_REQUEST['fond'])) and preg_match(',^formulaire_,i', $_REQUEST['fond']))
$ecran_securite_raison = "fond=formulaire_"; $ecran_securite_raison = "fond=formulaire_";
/* /*
* Bloque les requtes du type ?GLOBALS[type_urls]=toto (bug vieux php) * Bloque les requêtes du type ?GLOBALS[type_urls]=toto (bug vieux php)
*/ */
if (isset($_REQUEST['GLOBALS'])) if (isset($_REQUEST['GLOBALS']))
$ecran_securite_raison = "GLOBALS[GLOBALS]"; $ecran_securite_raison = "GLOBALS[GLOBALS]";
/* /*
* Bloque les requtes des bots sur: * Bloque les requêtes des bots sur:
* les agenda * les agenda
* les paginations entremles * les paginations entremélées
*/ */
if (_IS_BOT and ( if (_IS_BOT and (
(isset($_REQUEST['echelle']) and isset($_REQUEST['partie_cal']) and isset($_REQUEST['type'])) (isset($_REQUEST['echelle']) and isset($_REQUEST['partie_cal']) and isset($_REQUEST['type']))
...@@ -195,8 +195,8 @@ if (isset($_REQUEST[$var]) and is_array($_REQUEST[$var])) ...@@ -195,8 +195,8 @@ if (isset($_REQUEST[$var]) and is_array($_REQUEST[$var]))
if (!function_exists('tmp_lkojfghx')) { if (!function_exists('tmp_lkojfghx')) {
function tmp_lkojfghx() {} function tmp_lkojfghx() {}
function tmp_lkojfghx2($a = 0, $b = 0, $c = 0, $d = 0) { function tmp_lkojfghx2($a = 0, $b = 0, $c = 0, $d = 0) {
// si jamais on est arriv ici sur une erreur php // si jamais on est arrivé ici sur une erreur php
// et qu'un autre gestionnaire d'erreur est dfini, l'appeller // et qu'un autre gestionnaire d'erreur est défini, l'appeller
if ($b && $GLOBALS['tmp_xhgfjokl']) if ($b && $GLOBALS['tmp_xhgfjokl'])
call_user_func($GLOBALS['tmp_xhgfjokl'], $a, $b, $c, $d); call_user_func($GLOBALS['tmp_xhgfjokl'], $a, $b, $c, $d);
} }
...@@ -205,13 +205,13 @@ if (isset($_POST['tmp_lkojfghx3'])) ...@@ -205,13 +205,13 @@ if (isset($_POST['tmp_lkojfghx3']))
$ecran_securite_raison = "gumblar"; $ecran_securite_raison = "gumblar";
/* /*
* Outils XML mal scuriss < 2.0.9 * Outils XML mal sécurisés < 2.0.9
*/ */
if (isset($_REQUEST['transformer_xml'])) if (isset($_REQUEST['transformer_xml']))
$ecran_securite_raison = "transformer_xml"; $ecran_securite_raison = "transformer_xml";
/* /*
* Sauvegarde mal securise < 2.0.9 * Sauvegarde mal securisée < 2.0.9
*/ */
if (isset($_REQUEST['nom_sauvegarde']) if (isset($_REQUEST['nom_sauvegarde'])
and strstr((string)$_REQUEST['nom_sauvegarde'], '/')) and strstr((string)$_REQUEST['nom_sauvegarde'], '/'))
...@@ -223,14 +223,14 @@ and strstr((string)$_REQUEST['znom_sauvegarde'], '/')) ...@@ -223,14 +223,14 @@ and strstr((string)$_REQUEST['znom_sauvegarde'], '/'))
/* /*
* op permet des inclusions arbitraires ; * op permet des inclusions arbitraires ;
* on vrifie 'page' pour ne pas bloquer ... drupal * on vérifie 'page' pour ne pas bloquer ... drupal
*/ */
if (isset($_REQUEST['op']) and isset($_REQUEST['page']) if (isset($_REQUEST['op']) and isset($_REQUEST['page'])
and $_REQUEST['op'] !== preg_replace('/[^\-\w]/', '', $_REQUEST['op'])) and $_REQUEST['op'] !== preg_replace('/[^\-\w]/', '', $_REQUEST['op']))
$ecran_securite_raison = 'op'; $ecran_securite_raison = 'op';
/* /*
* Forms & Table ne se mfiait pas assez des uploads de fichiers * Forms & Table ne se méfiait pas assez des uploads de fichiers
*/ */
if (count($_FILES)){ if (count($_FILES)){
foreach($_FILES as $k => $v){ foreach($_FILES as $k => $v){
...@@ -257,13 +257,13 @@ and $_REQUEST['reinstall'] == 'oui') ...@@ -257,13 +257,13 @@ and $_REQUEST['reinstall'] == 'oui')
$ecran_securite_raison = 'reinstall=oui'; $ecran_securite_raison = 'reinstall=oui';
/* /*
* chappement xss referer * Échappement xss referer
*/ */
if (isset($_SERVER['HTTP_REFERER'])) if (isset($_SERVER['HTTP_REFERER']))
$_SERVER['HTTP_REFERER'] = strtr($_SERVER['HTTP_REFERER'], '<>"\'', '[]##'); $_SERVER['HTTP_REFERER'] = strtr($_SERVER['HTTP_REFERER'], '<>"\'', '[]##');
/* /*
* Rinjection des cls en html dans l'admin r19561 * Réinjection des clés en html dans l'admin r19561
*/ */
if (strpos($_SERVER['REQUEST_URI'], "ecrire/") !== false){ if (strpos($_SERVER['REQUEST_URI'], "ecrire/") !== false){
$zzzz = implode("", array_keys($_REQUEST)); $zzzz = implode("", array_keys($_REQUEST));
...@@ -310,13 +310,13 @@ if (!function_exists('filtre_filtrer_entites_dist')) { ...@@ -310,13 +310,13 @@ if (!function_exists('filtre_filtrer_entites_dist')) {
/* /*
* Fin scurit * Fin sécurité
*/ */
/* /*
* Bloque les bots quand le load dborde * Bloque les bots quand le load déborde
*/ */
if (!defined('_ECRAN_SECURITE_LOAD')) if (!defined('_ECRAN_SECURITE_LOAD'))
define('_ECRAN_SECURITE_LOAD', 4); define('_ECRAN_SECURITE_LOAD', 4);
...@@ -349,4 +349,3 @@ if ( ...@@ -349,4 +349,3 @@ if (
header("Content-Type: text/html"); header("Content-Type: text/html");
die("<html><title>Status 503: Site temporarily unavailable</title><body><h1>Status 503</h1><p>Site temporarily unavailable (load average $load)</p></body></html>"); die("<html><title>Status 503: Site temporarily unavailable</title><body><h1>Status 503</h1><p>Site temporarily unavailable (load average $load)</p></body></html>");
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter