*********************************************************** ¦ Versions vulnérables : News <= 5.2 ¦ ¦ Solution : Aucune officiel ¦ ¦ Auteur : contact@vincent-leclercq.com ¦ ¦ Web : www.vincent-leclercq.com ¦ ¦ Ddl: rapidshare.de/files/24454302/1844_news-52.zip.html ¦ *********************************************************** Problèmes ********* - Injections SQL - Cross Site Scripting - Full Path Disclosure Injections SQL ************** Le fichier 'divers.php' ne filtre pas correctement les variables 'id' et 'texte': --start divers.php-- // Line 10 if(!empty($_GET['action']) AND !empty($_GET['id'])) { $action = $_GET['action']; // requête SQL $sql2 = "SELECT id FROM ".$prefixe." WHERE id='".$_GET['id']."'"; //... Line 413 $sql2 = "SELECT commentaires FROM ".$prefixe." WHERE id='".$_GET['id']."'"; //... Line 434 $texte = strip_tags($_POST['texte']); //... Line 437 $sql = "INSERT INTO ".$prefixe."_comments(id, pseudo,titre, texte, date, news) VALUES('','$pseudo','$titre','$texte','$date','$id')" ---end divers.php--- Cross Site Scripting ******************** Toujours dans le fichiers 'divers.php', il ne filtre pas les variables 'id' et 'disabled': --start divers.php-- // Line 50 <form action="'.$PHP_SELF.'?action=envoyer&id='.$_GET['id'].'" method="post" name="add" OnSubmit="return champsok()"> //... Line 381 <td align="right" valign="center">Pseudo :</td><td><input class="'.$prefixe.'" type="text" name="pseudo" style="width:160px" '.$disabled.'></input></td> //... Yen a deux autres en plus pour disabled ---end divers.php--- Full Path Disclosure ******************** La variable 'mail' envoyé sur 'index.php', se voit appliqué la fonction htmlspecialchars(), celle-ci est limitée a des strings. On pourrait donc connaitre le chemin du site sur le serveur en envoyant un tableau mail[]. Proof Of Concept **************** Cross Site Scripting: http://[...]/divers.php?action=commentaires&commentaires=&id=1&disabled=%3C/textarea%3E%3Cscript%3Ealert(8)%3C/script%3E http://[...]/divers.php?action=envoyer&id=1%22%3Cscript%3Ealert(9)%3C/script%3E Injections SQL: http://[...]/divers.php?action=XXX&id='[SQL]%23 Full Path Disclosure: POST mail[]=XXX&submit=S%27inscrire (http://[...]/index.php] Solutions ********* S'applique uniquement pour les cas cités plus haut. Injections SQL => addslashes() Cross Site Scripting => htmlentities() Full Path Disclosure => is_string() Credits ******* Vulnérabilités trouvées par DarkFig URL : http://www.acid-root.new.fr/advisories/07060629.txt Exploit : http://www.acid-root.new.fr/poc/03060629.txt Changelog ********* [06-06-29] -- Version initiale [06-06-29] -- Vendeur contacté