Discuz 5.x/6.x/7.x poll SQL injection analysis

Source: Internet
Author: User

Look at the clouds, someone blew this. Vulnerability: http://www.wooyun.org/bugs/wooyun-2014-071516
The feeling should be a loophole in the editpost.inc.php vote. Because DZ has determined that it will not repair the 7.x before the loophole, so directly paste the details.
The problem is in editpost.inc.php 281 lines, the user commits the Polloption array directly parsed out into the SQL statement, because the default is only to filter the array value, not filter the key, so it will cause a delete injection.

?
1234567891011 $pollarray[‘options‘] = $polloption;if($pollarray[‘options‘]) {if(count($pollarray[‘options‘]) > $maxpolloptions) {showmessage(‘post_poll_option_toomany‘);}foreach($pollarray[‘options‘] as $key => $value) { //这里直接解析出来没处理$keyif(!trim($value)) {$db->query("DELETE FROM {$tablepre}polloptions WHERE polloptionid=‘$key‘ AND tid=‘$tid‘");unset($pollarray[‘options‘][$key]);}}

How to use:
Use your registered account to publish a poll post, then click "Edit", as

Then use burp to intercept the request, click "Edit Post", modify the Polloption as the injection statement:

Because the code determines that trim ($value) is empty, execute the following statement, so be sure to delete Fan Bingbing.

The return result has been successfully injected:

Patching method:

If it is not convenient to upgrade to Discuz X, you can modify the editpost.inc.php file to add a line:

?
1 $key = addslashes Code class= "PHP plain" > ( $key

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.