Simple CMS multiple SQL injection vulnerabilities-vulnerability warning-the black bar safety net

2013-10-31T00:00:00
ID MYHACK58:62201341096
Type myhack58
Reporter Matt@乌云
Modified 2013-10-31T00:00:00

Description

Detailed description:

1, the injection of a

public function accountAction() {

$user_mod = M ( "User" );

$data ['name'] = $_POST ["name"];

$data ['age'] = $_POST ["age"];

$data ['sex'] = $_POST ["sex"];

$data ['info'] = $_POST ["info"];

$province = ($_POST ['province'] == "select") ? "From : $_POST ['province'];

$city = ($_POST ['city'] == "please select") ? ": "|" . $_POST ['city'];

;

$county = ($_POST ['county'] == "please select") ? ": "|" . $_POST ['county'];

;

$data ['address'] = $province . $city . $county;

$name = $_POST ["name"];

$id = $_POST ["id"];//get

$user_info = $user_mod->where ( "name='$name' and is_del=0" )->find ();//query

$oldUname = $user_mod->where ( "id=$id and is_del=0" )->getField ( "name" );

echo "id=$id and is_del=0" ;

http://127.0.0.1/jd/index.php?a=accountAction&m=Uc&g=Home&id=1

post id=1%Inject_Here%

2, the injection of the second

public function likeItemsDel() {

$items_mod = M ( "Items" );

$user_mod = M ( "User" );

$items_id = $_GET ['id'];

$uid = $_COOKIE ['id'];

$items_likes_mod = M ( "Items_likes" );

$del = $items_likes_mod->where ( "items_id=$items_id & uid=$uid" )->delete ();

if ($del) {

$items_mod->where ( "id=$items_id" )->setDec ( 'likes', 1 ); // product of number of likes minus 1

$user_mod->where ( "id=$uid" )->setDec ( 'likes_num', 1 );

$url = get_url ( 'like', ", 'user' );

header ( 'location:' . $url );

}

}

http://127.0.0.1/jd/index.php?a=likeItemsDel&m=Uc&g=Home&id=1

Accept: /

Cookie: id=1%Inject_Here%

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; . NET CLR 2.0.50727) Havij

3, the injection three

public function albumItemsDel() {

C ( 'TOKEN_ON', false );

$items_id = $_GET ['id'];//get

$aid = $_GET ['aid'];//get

$items_mod = M ( "Items" );

$album_mod = M ( "Album" );

$album_items_mod = M ( "Album_items" );

$uid = $album_mod->where ( "id=$aid and is_del=0" )->getField ( "uid" );

echo "id=$aid and is_del=0";

if ($uid == $_COOKIE ['id']) {

$del = $album_items_mod->where ( "pid=$aid and items_id=$items_id" )->delete ();

if ($del) {

$url = get_url ( 'albumDetail', $aid, 'user' );

header ( 'location:' . $url );

}

}

}

http://127.0.0.1/jd/index.php?a=albumItemsDel&m=Uc&g=Home&aid=1

Vulnerability to prove:

!

Repair solutions:

Filter