Blogs & Stories

SpiderLabs Blog

Attracting more than a half-million annual readers, this is the security community's go-to destination for technical breakdowns of the latest threats, critical vulnerability disclosures and cutting-edge research.

Magic Home Pro Mobile Application Authentication Bypass (CVE-2020-27199)


With the prevalence of IoT devices flooding the mainstream marketplace, we tend to see a large proliferation of these devices lacking even basic security controls. Many of these devices are targeted for mainstream household environments and due to often unfettered internet access and device control through insecure mobile applications, this makes such devices a great playground for security researchers and malicious actors alike. One such device is the JadeHomic RGB Led Light Strip Kit and its associated mobile device application Magic Home Pro. I decided to turn my attention to investigating the security of this device and managed to uncover multiple vulnerabilities that could theoretically affect millions of devices.

App-ledsFigure 1: Magic Home Pro App and JadeHomic LED Kit


Finding 1: Unauthorized Information Disclosure/Unauthorized access

This vulnerability allows for any authenticated user to utilize their current authorization level to interrogate and control devices that are not currently apart of their registered account. This attack uses an API call to '/app/getBindedUserListByMacAddress/ZG001?macAddress=<mac address>', where the registered mac address can be uncovered by simply fuzzing the last three bytes of the mac address itself. The resulting HTTP response where a valid device exists will return the Username, User Unique Identifier (userUniID) and the Binded Unique ID (bindedUniID) of the associated user account. Using the above method, an attacker is now able to utilize a subsequent POST request to API endpoint '/app/sendCommandBatch/ZG001' using the newly enumerated mac address as a parameter to control the device. The device can now be controlled by an attacker by sending compatible hex strings '71230fa3' and '71240fa4' which translate to ON and OFF commands respectively.

EnumerationFigure 2: MAC and Account enumeration


Finding 2: JWT susceptibility to forgery and signature bypass

After a successful enumeration of targeted devices, it was further possible to use the discovered 'userID' and 'uniID'  within a forged JWT payload section to conduct a device takeover of another users' device. Utilizing a well-known JWT signature-bypass vulnerability, it was found that a malicious actor could take over a device of another user and therefore place it under the full control of the malicious actor. This attack uses an API call to '/app/shareDevice/ZG001' coupled with the 'friendUserID' JSON parameter to add the device to the attacker's device list. This gives the attacker full control of the endpoint device.


Finding 3: Magic Home Pro Authentication Bypass (CVE-2020-27199)

Utilizing the enumerated information above, an attacker is able to login to the mobile application using HTTP response manipulation. This results in an authentication bypass.

  1. Utilizing the JSON token forgery coupled with the gleaned information i.e. the Victim Email, ClientID, and UniqID based on the above enumeration it is possible to bypass the Mobile App authentication process through manipulating the HTTP response and thus gaining access to the Application as the victim.
  2. The attacker uses the Magic Home Pro application utilizing a victim email address, arbitrary password, and clientID.
  3. The attacker can then manipulate the HTTP response using the details in step 1 which allows for the bypass to take place.
Original HTTP Login Request via Magic Home Pro Mobile app
POST /app/login/ZG001 HTTP/1.1
User-Agent: Magic Home/1.5.1(ANDROID,9,en-US)
Accept-Language: en-US
Accept: application/json
Content-Type: application/json; charset=utf-8
Content-Length: 117
Host: wifij01us.magichue.net
Connection: close
Accept-Encoding: gzip, deflate
{"userID":"<victim userID>","password":"<arbitrary password>","clientID":"<arbitrary ClientID>"}

Original HTTP Response
HTTP/1.1 200
Server: nginx/1.10.3
Date: Thu, 08 Oct 2020 00:08:45 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 37
{"code":10033,"msg":"Password error"}

Edited HTTP Response
HTTP/1.1 200
Server: nginx/1.10.3
Date: Mon, 06 Jul 2020 12:32:02 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 907
{"code":0,"msg":"","data":{"webApi":"wifij01us.magichue.net/app","webPathOta":"http://wifij01us.magichue.net/app/ota/download","tcpServerController":"TCP,8816,ra8816us02.magichue.net","tcpServerBulb":"TCP,8815,ra8815us02.magichue.net","tcpServerControllerOld":"TCP,8806,mhc8806us.magichue.net","tcpServerBulbOld":"TCP,8805,mhb8805us.magichue.net","sslMqttServer":"ssl://","serverName":"Global","serverCode":"US","userName":"<victim userID>","userEmail":"<victim email>","userUniID":"<uniID gleaned from enumeration>"},"token":"<forged JWT based on gleaned data from API call>"}


Proof of Concept


At this time no patch is currently available for this issue however in order to limit the exposure it is recommended that network access to these devices should be permitted to authorized users only through the use of proper Access Control Lists and network segmentation.


TWSL2020-010: Multiple Vulnerabilities in Magic Home Pro Mobile Application
POC code: https://github.com/9lyph/CVE-2020-27199