Cijfer-cnxpl – CuteNews <=1.4.1 Remote Command Execution
This particular vulnerability is already known (sort of). A bug as exact as this one was found by rgod in CuteNews. The sole difference between his and my bug, are the files that are being exploited. While his was a bug using the following string: show_archives.php?template=../inc/ipban.mdu%00, I found my bug in: show_archives.php?template=../inc/categories.mdu%00. The bug lies in categories.mdu, located in the /inc/ folder of the cutenews directory. By using the 'template' variable in show_archives.php, we can include any local files. In this case, we're including categories.mdu. Every .mdu file within the cutenews package has raw PHP code within it, that is not protected like the normal .php files. $template gets sanitized, but can be bypassed depending on php configuration! This is why on some 1.4.0's it works and on some others it does not. It all depends on configuration and whether or not register_globals needs to be on. Looking into categories.mdu, we notice the following to create our exploit string: if($member_db[1] != 1){ msg("error", "Access Denied", "You don't have permission to edit categories"); } elseif($action == "doedit") { cannot write arbitrary php code to $cat_name :( $cat_name = htmlspecialchar($cat_name); but we can write arbitrary php code to $cat_icon! $cat_icon = htmlspecialchar($cat_icon); so, we can write arbitrary php code to $cat_icon, and execute it.