Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

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

Overview

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
token:
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://192.168.0.112:1883","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

Summary

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.

References

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

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo