Latest compatibility info is available at the pecl page - https://pecl.php.net/package/taint shows that latest compatibility is 7+, and a windows DLL is available.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.
Lorsque taint est actif, si une chaîne corrompue (provenant de $_GET, $_POST ou $_COOKIE) est passée à des fonctions, taint émettra une alerte.
Exemple #1 Exemple avec Taint()
<?php
$a = trim($_GET['a']);
$file_name = '/tmp' . $a;
$output = "Welcome, {$a} !!!";
$var = "output";
$sql = "Select * from " . $a;
$sql .= "ooxx";
echo $output;
print $$var;
include $file_name;
mysql_query($sql);
?>Résultat de l'exemple ci-dessus est similaire à :
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
Latest compatibility info is available at the pecl page - https://pecl.php.net/package/taint shows that latest compatibility is 7+, and a windows DLL is available.