{================================================================================} { [waraxe-2004-SA#001] } {================================================================================} { } { [ Script injection in GBook for Php-Nuke ver. 1.0 ] } { } {================================================================================} Author: Janek Vind "waraxe" Date: 02 Feb 2004 Affected software description: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Php-Nuke is popular freeware content management system, written in php by Francisco Burzi. GBook is guestbook module for Php-Nuke, created by Germán Cuevas and Víctor Simental, http://www.php-mania.com.ar Vulnerabilities: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Gbook script does`nt sanityze user input at all, so anybody, who can make entries to guestbook, can inject there potentially hostile html tags. This can lead to cookie stealing and extracting usernames and password md5 hashes for Php-Nuke. Exploit: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Html tags can be injected on many places on guestbook entry - "name", "email", "city","message", etc. Choose what you prefer. Next, GBook uses POST request to submit data to server, but Php-Nuke itself has filter for $_POST[] variables: ##### Php-Nuke 7.0 mainfile.php line 56 ####################################### foreach ($_POST as $secvalue) { if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]*style*\"?[^>]*>", $secvalue))) { die ("