Discuz 5.x/ 6.x/ 7.x SQL Injection Analysis

Source: Internet
Author: User

Discuz 5.x/ 6.x/ 7.x SQL Injection Analysis

It seems that someone has cracked this vulnerability. It should be the vulnerability in editpost. inc. php. Because dz has confirmed that it will not fix vulnerabilities earlier than 7.x, paste the details directly.

The problem lies in editpost. inc. in line 1 of php, The polloption array submitted by the user is directly parsed into an SQL statement, because by default, only the array value is filtered, instead of the filter key, resulting in a DELETE injection.

$ Pollarray ['options'] = $ polloption; if ($ pollarray ['options']) {if (count ($ pollarray ['options'])> $ maxpolloptions) {showmessage ('Post _ poll_option_too=');} foreach ($ pollarray ['options'] as $ key => $ value) {// The $ keyif (! Trim ($ value) {$ db-> query ("delete from {$ tablepre} polloptions WHERE polloptionid = '$ key' AND tid =' $ tid '"); unset ($ pollarray ['options'] [$ key]);}

Usage:

Use the registered account to publish a voting post and click "edit", as shown in figure

 

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

 

Because the Code determines that trim ($ value) is null to execute the following statement, Fan Bingbing must be deleted.

The returned results have been successfully injected:

 

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.