CVE-2020-14008 - Unrestricted Upload of File with Dangerous Type

Severity

72%

Complexity

12%

Confidentiality

98%

Zoho ManageEngine Applications Manager 14710 and before allows an authenticated admin user to upload a vulnerable jar in a specific location, which leads to remote code execution.

CVSS 3.1 Base Score 7.2. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

CVSS 2.0 Base Score 6.5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:S/C:P/I:P/A:P).

Demo Examples

Unrestricted Upload of File with Dangerous Type

CWE-434

The following code intends to allow a user to upload a picture to the web server. The HTML code that drives the form on the user end has an input field of type "file".


               
</form>

Once submitted, the form above sends the file to upload_picture.php on the web server. PHP stores the file in a temporary location until it is retrieved (or discarded) by the server side code. In this example, the file is moved to a more permanent pictures/ directory.


               
}// Define the target location where the picture being// uploaded is going to be saved.// Move the uploaded file to the new location.
echo "The picture has been successfully uploaded.";
echo "There was an error uploading the picture, please try again.";

The problem with the above code is that there is no check regarding type of file being uploaded. Assuming that pictures/ is available in the web document root, an attacker could upload a file with the name:


               
malicious.php

Since this filename ends in ".php" it can be executed by the web server. In the contents of this uploaded file, the attacker could use:


               
?>
system($_GET['cmd']);

Once this file has been installed, the attacker can enter arbitrary commands to execute using a URL such as:


               
http://server.example.com/upload_dir/malicious.php?cmd=ls%20-l

which runs the "ls -l" command - or any other type of command that the attacker wants to specify.

Unrestricted Upload of File with Dangerous Type

CWE-434

The following code demonstrates the unrestricted upload of a file with a Java servlet and a path traversal vulnerability. The HTML code is the same as in the previous example with the action attribute of the form sending the upload file request to the Java servlet instead of the PHP code.


               
</form>

When submitted the Java servlet's doPost method will receive the request, extract the name of the file from the Http request header, read the file contents from the request and output the file to the local upload directory.


               
}
{...}
// output successful upload response HTML page
bw.close();
}
bw.flush();
...

As with the previous example this code does not perform a check on the type of the file being uploaded. This could allow an attacker to upload any executable file or other file with malicious code.

Additionally, the creation of the BufferedWriter object is subject to relative path traversal (CWE-22, CWE-23). Depending on the executing environment, the attacker may be able to specify arbitrary files to write to, leading to a wide variety of consequences, from code execution, XSS (CWE-79), or system crash.

Overview

First reported 4 years ago

2020-09-04 15:15:00

Last updated 4 years ago

2020-09-16 14:38:00

Affected Software

Zoho Corp ManageEngine Applications Manager 14.0

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14000

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14010

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14020

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14030

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14040

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14050

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14060

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14070

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14071

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14072

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14073

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14080

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14090

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14100

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14110

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14120

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14130

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14140

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14150

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14160

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14170

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14180

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14190

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14200

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14210

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14220

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14230

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14240

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14250

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14260

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14261

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14262

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14270

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14280

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14290

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14300

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14310

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14330

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14331

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14332

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14340

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14350

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14360

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14361

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14370

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14380

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14390

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14400

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14401

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14410

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14420

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14430

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14440

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14450

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14460

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14470

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14480

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14490

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14500

14.0

Zoho Corp ManageEngine Applications Manager 14.0 Build14510

14.0

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.