Tried, Tested and Proven

Vulnerability title: Reflective XSS In X2Engine Inc. X2Engine

CVE: CVE-2015-5076
Vendor: X2Engine Inc.
Product: X2Engine
Affected version: 4.2
Fixed version: 5.2
Reported by: Simone Quatrini

Details:

The X2Engine web application was vulnerable to reflective Cross-Site Scripting where user supplied data is used to generate the subsequent response. This is a normal feature of many applications, however, in this instance the application failed to restrict the type of data that was accepted and also failed to sanitise it, meaning that it could not be safely rendered by the browser.

A number of locations were identified as being vulnerable, including:

x2engine/protected/views/admin/formEditor.php:144:<a style="float:right;position:relative;top:10px;" href="deleteVersion?version=<?php echo isset($_GET['version'])?$_GET['version']:'';?>" class="x2-button">Delete Selected Version</a>

x2engine/protected/views/admin/rollbackImport.php:99:    <?php echo Yii::t('admin','Import ID: '); ?><strong><?php echo $_GET['importId'];?></strong>

x2engine/protected/views/site/listener.php:69:    if (!empty($_GET['bc'])) echo $_GET['bc'];
x2engine/protected/views/site/listener.php:83:    <?php if (!empty($_GET['fg'])) echo 'color: '. $_GET['fg'] .";\n"; unset($_GET['fg']); ?>
x2engine/protected/views/site/listener.php:84:    <?php if (!empty($_GET['bgc'])) echo 'background-color: '. $_GET['bgc'] .";\n"; unset($_GET['bgc']); ?>
x2engine/protected/views/site/listener.php:87:        echo 'font-family: '. FontPickerInput::getFontCss($_GET['font']) .";\n";
x2engine/protected/components/views/webForm.php:292:                value="<?php echo isset($_POST['Services'][$field['fieldName']]) ?

x2engine/protected/components/TranslationManager.php:383:<input type="hidden" name="file" value="<?php echo $_GET['file']; ?>">

x2engine/protected/tests/webscripts/x2WebTrackingTestPages/customWebLeadCaptureScriptTest.php:61:<div id="success">success<?php echo $_POST['x2_key']; ?></div>

x2engine/protected/modules/contacts/controllers/ContactsController.php:577:                        echo $_POST['id'];
x2engine/protected/modules/contacts/controllers/ContactsController.php:581:                        echo $_POST['id'];

An attacker could create a malicious link with the following URL:

http://localhost/x2engine/index.php/profile/getEvents?lastEventId=<img src=a onerror=alert('xss')>&lastTimestamp=1408631575&profileId=3&myProfileId=3

Impact:

An attacker could exploit this flaw to get active HTML or script code executed in an authenticated user’s browser. Cross-site Scripting may be used to perform attacks such as session hijacking by invoking the user’s browser to send information stored in their cookies (such as a session identification token) to an arbitrary location controlled by the attacker. Furnished with this information the attacker could immediately access the site, masquerading as the authenticated user who viewed the page containing the malicious code. The attacker would then be able to perform actions as the authorised user, subject to their role, which could include viewing sensitive data, modifying profile information and making transactions.

This vulnerability could also be leveraged in a phishing attack, whereby the attacker adds additional HTML code to create a false login page within the vulnerable page, which posts the data to a server controlled by the attacker. The attacker could then redirect the user back to the original server, thus giving the illusion that the login was secure and genuine. This could also be achieved by redirecting the user to a false login page on the attacker’s server rather than adding the code to a page that already exists. This is critical, because if the attacker could host a “phishing” website in a domain with a valid SSL certificate, there would be no way for a user to spot the attack.

A variation of the “phishing” attack described above would be to inject code to completely rewrite the genuine page, defacing the site and possibly having a detrimental impact on the reputation of the company.

Finally, an attacker could use Cross-site Scripting to exploit vulnerabilities within web browsers. The outcome of such an attack would depend on the exploits used, but in a worst case scenario the attacker could gain full control of a user’s computer. Once that had been achieved it would be trivial for the attacker to install a keystroke logger and gain access to applications via the usernames and passwords they had acquired.

In the case of the current web application, the Cross-site Scripting was “reflective”, meaning that a user would need to follow a specially crafted link for the attack to be successful.

Exploit:

Exploit code not required.

Remediation:

The vendor has released a patch.

Vendor status:

15/09/2014 Submitted initial contact via web form on X2Engine’s page
30/09/2014 Second initial contact message sent via web form
08/12/2014 Final chaser sent via their web form
20/01/2015 Automated response from the X2 website received on 08/12/2014. Attempting to contact the email address that it was sent from “john@x2engine.com”. If no response by the end of the week will start forced disclosure process
21/01/2015 Initial vendor response, details over vulnerability sent
26/02/2015 Chaser sent to vendor
17/04/2015 Second chaser sent to vendor
08/06/2015 Chaser sent to vendor. Unsure if his emails are getting through to us as he stated that he has been replying
08/06/2015 Vendor responded stating that they needed vulnerability details even though I had sent them months ago
09/06/2015 Vendor is approximately 75% through fix and will have a patch out within the next few weeks
26/06/2015 MITRE assigned CVE-2015-5076
13/07/2015 Vendor asked for CVEs to add to their page. Should be ready for publish soon when they have given their clients time to patch
22/07/2015 Email from vendor stating that they released the fix for this on 13/07/2015 and asked when we would be disclosing
23/07/2015 Vendor has asked if we wait off until they release their next major update (At some point in the next 2 weeks). Confirmed this is fine and to contact us when they have a release date confirmed for it
24/08/2015 Replied to the vendor
26/08/2015 Vendor confirmed that they are ready for us to publish
18/09/2015 Published
Copyright:

Copyright © Portcullis Computer Security Limited 2015, All rights reserved worldwide. Permission is hereby granted for the electronic redistribution of this information. It is not to be edited or altered in any way without the express written consent of Portcullis Computer Security Limited.

Disclaimer:

The information herein contained may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user’s risk. In no event shall the author/distributor (Portcullis Computer Security Limited) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.