Phpwind 7/8 Remote Code Execution Vulnerability and repair

Source: Internet
Author: User

Release date: 2010-09.05
Author: Jie Shi
Affected Version: phpwind 7/8.
Official Address: www.phpwind.net
Vulnerability Type: SQL Injection

Vulnerability Description: A severe vulnerability exists in phpwind forums of higher versions. Successful exploitation of this vulnerability can remotely execute any php code, affecting phpwind 7 and phpwind 8.

Detailed description:
In pw_ajax.php


} Elseif ($ action = pcdelimg ){

InitGP (array (fieldname, pctype ));

InitGP (array (tid, id), 2 );

If (! $ Tid |! $ Id |! $ Fieldname |! $ Pctype ){

Echo fail;

}

$ Id = (int) $ id;

If ($ pctype = topic ){

$ Tablename = GetTopcitable ($ id );

} Elseif ($ pctype = postcate ){

$ Tablename = GetPcatetable ($ id );

}


$ Path = $ db-> get_value ("SELECT $ fieldname FROM $ tablename WHERE tid =". pwEscape ($ tid ));

Fieldname does not have any effective filtering (some of the other global funny looks good filtering does not have any security significance here, but it only brings some difficulty to exploit the vulnerability ), this injection can be used to obtain data from any database.

In addition, class_other.php has the arbitrary command execution vulnerability.


Function threadscateGory ($ classdb) {// generates a post exchange category

$ Classcache = "<? Php $ info_class = array (";


Foreach ($ classdb as $ key => $ class ){


! $ Class [ifshow] & $ class [ifshow] = 0;

$ Flag & $ info_class [$ class [cid] [ifshow] & $ class [ifshow] = 1;


$ Class [name] = str_replace (array ("," "), array (" & quot; "," & #39; "), $ class [name]);

$ Classcache. = "$ class [cid] =>". pw_var_export ($ class ).",";

}

$ Classcache. = ");?> ";

Writeover (D_P. "data/bbscache/info_class.php", $ classcache );

}

$ Class [cid] requires some key to enter this logic without filtering. The key can be obtained through the above injection vulnerability.

 

Solution:

Filter keywords and follow official updates

Supplement: Official just released patch, please promptly update: html "> http://www.phpwind.net/read-htm-tid-1081824.html


 

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.