Browse Source

fix: Sanitizer toutes les valeurs passées aux formulaires preventivement dans l'écran de sécurité

Refs: spip-team/securite#4839
pull/5508/head
Cerdic 4 weeks ago committed by Matthieu Marcillaud
parent
commit
c76770adfa
  1. 18
      config/ecran_securite.php

18
config/ecran_securite.php

@ -5,7 +5,7 @@
* ------------------
*/
define('_ECRAN_SECURITE', '1.4.2'); // 2022-07-12
define('_ECRAN_SECURITE', '1.5.0'); // 2023-02-27
/*
* Documentation : https://www.spip.net/fr_article4200.html
@ -649,6 +649,22 @@ if (
$ecran_securite_raison = "malformed _oups argument";
}
if (
isset($_REQUEST['formulaire_action_args'])
) {
foreach ($_REQUEST as $k => $v) {
if (is_string($v)
and strpos($v, ':') !== false
and strpos($v, '"') !==false
and preg_match(',[bidsaO]:,', $v)
and @unserialize($v)) {
$_REQUEST[$k] = htmlentities($v);
if (isset($_POST[$k])) $_POST[$k] = $_REQUEST[$k];
if (isset($_GET[$k])) $_GET[$k] = $_REQUEST[$k];
}
}
}
/*
* S'il y a une raison de mourir, mourons

Loading…
Cancel
Save