CVE-2015-0691 - Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Severity

93%

Complexity

86%

Confidentiality

165%

A certain Cisco JAR file, as distributed in Cache Cleaner in Cisco Secure Desktop (CSD), allows remote attackers to execute arbitrary commands via a crafted web site, aka Bug ID CSCup83001.

A certain Cisco JAR file, as distributed in Cache Cleaner in Cisco Secure Desktop (CSD), allows remote attackers to execute arbitrary commands via a crafted web site, aka Bug ID CSCup83001.

CVSS 2.0 Base Score 9.3. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:C/I:C/A:C).

Demo Examples

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

CWE-78

This example code intends to take the name of a user and list the contents of that user's home directory. It is subject to the first variant of OS command injection.


               
system($command);

The $userName variable is not checked for malicious input. An attacker could set the $userName variable to an arbitrary OS command such as:


               
;rm -rf /

Which would result in $command being:


               
ls -l /home/;rm -rf /

Since the semi-colon is a command separator in Unix, the OS would first execute the ls command, then the rm command, deleting the entire file system.

Also note that this example code is vulnerable to Path Traversal (CWE-22) and Untrusted Search Path (CWE-426) attacks.

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

CWE-78

This example is a web application that intends to perform a DNS lookup of a user-supplied domain name. It is subject to the first variant of OS command injection.


               
}
close($fh);
print "<br>\n";

Suppose an attacker provides a domain name like this:


               
cwe.mitre.org%20%3B%20/bin/ls%20-l

The "%3B" sequence decodes to the ";" character, and the %20 decodes to a space. The open() statement would then process a string like this:


               
/path/to/nslookup cwe.mitre.org ; /bin/ls -l

As a result, the attacker executes the "/bin/ls -l" command and gets a list of all the files in the program's working directory. The input could be replaced with much more dangerous commands, such as installing a malicious program on the server.

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

CWE-78

The example below reads the name of a shell script to execute from the system properties. It is subject to the second variant of OS command injection.


               
System.exec(script);

If an attacker has control over this property, then they could modify the property to point to a dangerous program.

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

CWE-78

In the example below, a method is used to transform geographic coordinates from latitude and longitude format to UTM format. The method gets the input coordinates from a user through a HTTP request and executes a program local to the application server that performs the transformation. The method passes the latitude and longitude coordinates as a command-line option to the external program and will perform some processing to retrieve the results of the transformation and return the resulting UTM coordinates.


               
}
return utmCoords;
// process results of coordinate transform// ...

However, the method does not verify that the contents of the coordinates input parameter includes only correctly-formatted latitude and longitude coordinates. If the input coordinates were not validated prior to the call to this method, a malicious user could execute another program local to the application server by appending '&' followed by the command for another program to the end of the coordinate string. The '&' instructs the Windows operating system to execute another program.

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

CWE-78

The following code is from an administrative web application designed to allow users to kick off a backup of an Oracle database using a batch-file wrapper around the rman utility and then run a cleanup.bat script to delete some temporary files. The script rmanDB.bat accepts a single command line parameter, which specifies what type of backup to perform. Because access to the database is restricted, the application runs the backup as a privileged user.


               
...
"&&c:\\utl\\cleanup.bat\"")

The problem here is that the program does not do any validation on the backuptype parameter read from the user. Typically the Runtime.exec() function will not execute multiple commands, but in this case the program first runs the cmd.exe shell in order to run multiple commands with a single call to Runtime.exec(). Once the shell is invoked, it will happily execute multiple commands separated by two ampersands. If an attacker passes a string of the form "& del c:\\dbms\\*.*", then the application will execute this command along with the others specified by the program. Because of the nature of the application, it runs with the privileges necessary to interact with the database, which means whatever command the attacker injects will run with those privileges as well.

Overview

Type

Cisco Secure Desktop

First reported 9 years ago

2015-04-17 01:59:00

Last updated 8 years ago

2017-01-06 16:05:00

Affected Software

Cisco Secure Desktop 3.0 BASE

3.0_base

Cisco Secure Desktop 3.1.0.31

3.1.0.31

Cisco Secure Desktop 3.1.1

3.1.1

Cisco Cisco Secure Desktop 3.1.1.45

3.1.1.45

Cisco Secure Desktop 3.1 BASE

3.1_base

Cisco Secure Desktop 3.2.0.136

3.2.0.136

Cisco Secure Desktop 3.2.1.103

3.2.1.103

Cisco Secure Desktop 3.2.1.126

3.2.1.126

Cisco Secure Desktop 3.2 BASE

3.2_base

Cisco Secure Desktop 3.3.0.118

3.3.0.118

Cisco Secure Desktop 3.3.0.151

3.3.0.151

Cisco Secure Desktop 3.3 BASE

3.3_base

Cisco Secure Desktop 3.4.0373

3.4.0373

Cisco Secure Desktop 3.4.1108

3.4.1108

Cisco Secure Desktop 3.4.2048

3.4.2048

Cisco Secure Desktop 3.4 BASE

3.4_base

Cisco Secure Desktop 3.5.841

3.5.841

Cisco Secure Desktop 3.5.1077

3.5.1077

Cisco Secure Desktop 3.5.2001

3.5.2001

Cisco Secure Desktop 3.5.2003

3.5.2003

Cisco Secure Desktop 3.5.2008

3.5.2008

Cisco Secure Desktop 3.5 BASE

3.5_base

Cisco Secure Desktop 3.6.181

3.6.181

Cisco Secure Desktop 3.6.185

3.6.185

Cisco Secure Desktop 3.6.1001

3.6.1001

Cisco Secure Desktop 3.6.2002

3.6.2002

Cisco Secure Desktop 3.6.3002

3.6.3002

Cisco Secure Desktop 3.6.4021

3.6.4021

Cisco Secure Desktop 3.6.5005

3.6.5005

Cisco Secure Desktop 3.6.6020

3.6.6020

Cisco Secure Desktop 3.6.6104

3.6.6104

Cisco Secure Desktop 3.6.6203

3.6.6203

Cisco Secure Desktop 3.6.6210

3.6.6210

Cisco Secure Desktop 3.6.6228

3.6.6228

Cisco Secure Desktop 3.6.6234

3.6.6234

Cisco Secure Desktop 3.6.6249

3.6.6249

Cisco Secure Desktop 3.6 BASE

3.6_base

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.