{================================================================================} { [waraxe-2004-SA#018] } {================================================================================} { } { [ Admin-level authentication bypass in phpnuke 6.x-7.2] } { } {================================================================================} Author: Janek Vind "waraxe" Date: 12. April 2004 Location: Estonia, Tartu Web: http://www.waraxe.us/index.php?modname=sa&id=18 Affected software description: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Php-Nuke is popular freeware content management system, written in php by Francisco Burzi. This CMS (Content Management System) is used on many thousands websites, because it`s free of charge, easy to install and has broad set of features. Homepage: http://phpnuke.org Vulnerabilities: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This time we will try to create superadmin account without any authentication at all. First, let's look at original code in auth.php line 48: $admintest = 0; if(isset($admin) && $admin != "") { $admin = base64_decode($admin); $admin = explode(":", $admin); $aid = "$admin[0]"; $pwd = "$admin[1]"; Again we can see, that base64decoded variable "admin" from cookie will be exploded to components - admin id and password's md5 hash. As alway with base64 encode/decode operation, care must by taken with special symbols, like single quotes. Before using the base64decoded information, addslashes() function must be used. But let's look at auth.php code further: if ($aid=="" || $pwd=="") { $admintest=0; echo "\n"; echo "