1. Advisory Information Title: TP-LINK TDDP Multiple Vulnerabilities Advisory ID: CORE-2016-0007 Advisory URL: http://www.coresecurity.com/advisories/tp-link-tddp-multiple-vulnerabilities Date published: 2016-11-21 Date of last update: 2016-11-18 Vendors contacted: TP-Link Release mode: User release 2. Vulnerability Information Class: Missing Authentication for Critical Function [CWE-306], Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') [CWE-120] Impact: Code execution, Information leak Remotely Exploitable: Yes Locally Exploitable: No CVE Name: CVE-pending-assignment-1, CVE-pending-assignment-2 3. Vulnerability Description TP-LINK [1] ships some of their devices with a debugging protocol activated by default. This debugging protocol is listening on the 1040 UDP port on the LAN interface. Vulnerabilities were found in the implementation of this protocol, that could lead to remote code execution and information leak (credentials acquisition). 4. Vulnerable Devices TP-LINK WA5210g. (Firmware v1 and v2 are vulnerable) Other devices might be affected, but they were not tested. 5. Vendor Information, Solutions and Workarounds No workarounds are available for this device. 6. Credits This vulnerability was discovered and researched by Andres Lopez Luksenberg from Core Security Exploit Team. The publication of this advisory was coordinated by Joaquin Rodriguez Varela from Core Advisories Team. 7. Technical Description / Proof of Concept Code TP-LINK distributes some of their hardware with a debugging service activate by default. This program uses a custom protocol. Vulnerabilities were found using this protocol, that could lead to remote code execution or information leak. 7.1. Missing Authentication for TDDP v1 [CVE-pending-assignment-1] If version 1 is selected when communicating with the TDDP service, there is a lack of authentication in place. Additionally if the message handler accepts the "Get configuration" message type, this will result in the program leaking the web interface configuration file, which includes the web login credentials. The following is a proof of concept to demonstrate the vulnerability (Impacket [2] is required for the PoC to work): import socket import re from impacket.winregistry import hexdump from impacket.structure import Structure import struct class TDDP(Structure): structure = ( ('version','B=0x1'), ('type','B=0'), ('code','B=0'), ('replyInfo','B=0'), ('packetLength','>L=0'), ('pktID','L=0'), ('pktID','