Aide - Recherche - Membres - Calendrier
Version complète : [Résolu] Sécurisation du cPath ?
Forum osCommerce-fr > Adapter OsCommerce MS2 > Sécurité - Mises à jour
Havock
J'ai une question probablement stupide, mais on ne sait jamais (comme mon serveur est assez attaqué en ce moment je deviens un peu parano blink.gif )

En me replongeant dans le code j'en vient à me poser la question sur la sécurité au niveau du paramètre cPath.

Les autres paramètres passés en GET sont tous sécurisés par tep_db_prepare_input , tep_sanitize_string ou tep_db_prepare_input , mais je n'ai pas vu où cPath était . Je n'ai pas bien regardé ou ce n'est pas génant ?
Gnidhal
pas bien grave: cPath est difficile à détourner :
dans application_top:
Code
// calculate category path
  if (isset($HTTP_GET_VARS['cPath'])) {
    $cPath = $HTTP_GET_VARS['cPath'];
  } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
    $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
  } else {
    $cPath = '';
  }

  if (tep_not_null($cPath)) {
    $cPath_array = tep_parse_category_path($cPath);
    $cPath = implode('_', $cPath_array);
    $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
  } else {
    $current_category_id = 0;
  }

soit c'est un entier, soit c'est une chaine splittée sur le _ et transformé en tableau d'entiers.
Allez, bonne chance les black-hats smile.gif
Havock
Merci pour cette précision Gnidhal smile.gif
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'informations, la mise en page et les images, veuillez cliquer ici.
Invision Power Board © 2001-2024 Invision Power Services, Inc.