<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.other.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'book.taint.php',
    1 => 'Taint',
    2 => 'Taint',
  ),
  'up' => 
  array (
    0 => 'refs.basic.other.php',
    1 => 'Autres extensions basiques',
  ),
  'prev' => 
  array (
    0 => 'yaconf.has.php',
    1 => 'Yaconf::has',
  ),
  'next' => 
  array (
    0 => 'taint.setup.php',
    1 => 'Installation/Configuration',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/taint/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.taint.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.taint" class="book">
 
 <h1 class="title">Taint</h1>
 

 <div id="intro.taint" class="preface">
  <h1 class="title">Introduction</h1>
  <p class="para">
   Taint est une extension dont le but est de détecter les codes XSS (chaîne
   de caractères corrompue).
   Cette extension peut être utilisée pour mettre en lumière certaines
   vulnérabilités concernant des injections SQL, des injections shell, etc.
  </p>
  <p class="para">
   Lorsque taint est actif, si une chaîne corrompue (provenant de <var class="varname"><a href="reserved.variables.get.php" class="classname">$_GET</a></var>,
   <var class="varname"><a href="reserved.variables.post.php" class="classname">$_POST</a></var> ou <var class="varname"><a href="reserved.variables.cookies.php" class="classname">$_COOKIE</a></var>) est passée à des fonctions, taint émettra une alerte.
  </p>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple avec <span class="function"><a href="function.taint.php" class="function">Taint()</a></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">[</span><span style="color: #DD0000">'a'</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB">$file_name </span><span style="color: #007700">= </span><span style="color: #DD0000">'/tmp' </span><span style="color: #007700">.  </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$output    </span><span style="color: #007700">= </span><span style="color: #DD0000">"Welcome, </span><span style="color: #007700">{</span><span style="color: #0000BB">$a</span><span style="color: #007700">}</span><span style="color: #DD0000"> !!!"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$var       </span><span style="color: #007700">= </span><span style="color: #DD0000">"output"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sql       </span><span style="color: #007700">= </span><span style="color: #DD0000">"Select *  from " </span><span style="color: #007700">. </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sql      </span><span style="color: #007700">.= </span><span style="color: #DD0000">"ooxx"</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #0000BB">$output</span><span style="color: #007700">;<br /><br />print $</span><span style="color: #0000BB">$var</span><span style="color: #007700">;<br /><br />include </span><span style="color: #0000BB">$file_name</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
Warning: main() [function.echo]: Attempt to echo a string that might be tainted

Warning: main() [function.echo]: Attempt to print a string that might be tainted

Warning: include() [function.include]: File path contains data that might be tainted

Warning: mysql_query() [function.mysql-query]: SQL statement contains data that might be tainted
</pre></div>
   </div>
  </div>
 </div>

 







 








 









<ul class="chunklist chunklist_book"><li><a href="taint.setup.php">Installation/Configuration</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="taint.installation.php">Installation</a></li><li><a href="taint.configuration.php">Configuration &agrave; l'ex&eacute;cution</a></li></ul></li><li><a href="taint.detail.php">Plus de d&eacute;tails</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="taint.detail.basic.php">Fonctions et requ&ecirc;tes qui seront marqu&eacute;es comme cha&icirc;nes non propres</a></li><li><a href="taint.detail.taint.php">Fonctions et requ&ecirc;tes qui v&eacute;rifieront si la cha&icirc;ne est propre</a></li><li><a href="taint.detail.untaint.php">Fonctions qui ne nettoieront pas une cha&icirc;ne non propre</a></li></ul></li><li><a href="ref.taint.php">Fonctions Taint</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.is-tainted.php">is_tainted</a> — V&eacute;rifie si une cha&icirc;ne est corrompue</li><li><a href="function.taint.php">taint</a> — Marque une cha&icirc;ne comme corrompue</li><li><a href="function.untaint.php">untaint</a> — Retire la corruption d'une cha&icirc;ne</li></ul></li></ul></div><?php manual_footer($setup); ?>