CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

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

twi-managed-portal-color
Co-Managed SOC (SIEM)

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

twi-briefcase-color-svg
Advisory & Diagnostics

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

tw-laptop-data
Penetration Testing

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

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

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

tw-officer
Digital Forensics & Incident Response

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

tw-network
Firewall & Technology Management

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

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
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
SpiderLabs Blog

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

Latest SpiderLabs Blogs

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More