目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2020-12702 PoC — eWeLink mobile application 加密问题漏洞

来源
关联漏洞
标题: eWeLink mobile application 加密问题漏洞 (CVE-2020-12702)
Description:IFTTT eWeLink是 IFTTT开源的一个应用软件。提供远程开关风扇和灯、控制风速和调灯光。 eWeLink mobile application 存在安全漏洞,该漏洞源于快速配对模式下的弱加密,在配对过程中,攻击者可利用该漏洞窃听Wi-Fi凭证等敏感信息。
Description
This repo describes a vulnerability affecting the QR code based pairing process of the eWeLink IoT devices (CVE-2020-12702).
介绍
# eWeLink mobile Application - Incorrect Access Control Vulnerability (CVE-2021-27941)
Unconstrained Web access to the device's private encryption key in the QR code pairing mode in the eWeLink mobile application (through 4.9.2 on Android and through 4.9.1 on iOS) allows a physically proximate attacker to eavesdrop on Wi-Fi credentials and other sensitive information by monitoring the Wi-Fi spectrum during a device pairing process.

# Pairing protocol and vulnerability details
From the user perspective, the QR code-based pairing process between the IoT device and the user’s WiFi, through the eWeLink application, acts as follows:
- the user boots the IoT device into paring mode.
- the user scans the QR-code attached to the IoT device with the eWeLink application.
- the application connects to a remote service to retrieve some device information, among which the device secret-key.
- the application connects to the device soft AP WiFi.
- the application uses the device secret key to encrypt a message with the target WiFi credential and send it to the device.
- the device uses the credential to access the home WiFi network,
- the eWeLink application adds the IoT device to the user’s device list (using a remote Cloud service).

The QR code label supplied with a supported device (a Sonoff Micro from ITEAD) encodes the following URL https://api.coolkit.cn:8080/add-ap-device?brand=ewelink\&ssid=ITEAD-device_id, where:
- the SSID parameter is the name of the WiFi network that is broadcasted by the device during the pairing process.
- the device_id is an alphanumeric string that represents the unique device id, which is used by the eWeLink application to query the Coolkit remote API and retrieve the device private encryption key (previously referenced as secret key).


During the first step, the application connects to eu-api.coolkit.cc:8080/api/user/fdbaseinfo?deviceid=device_id&other_parameters endpoint, from which it retrieves the device secret-key, along with other device information. According to the above-described flow, the service invoked by the application returns a key that is then used to encrypt (using the AES algorithm) the user’s WiFi credentials before sending them to the IoT device through the dedicated softAP WiFi network.
An encrypted JSON message is sent through an http post request to the open device http server.
The original payload follows the structure reported below:
```{"ssid" : "Test-Network", "password" : "Test-Password", "serverName" : "eu-disp.coolkit.cc", "port" : 443}```
where the "Test-Network" and "Test-Password" parameters are the network credentials we chose for our testbed configuration, and the eu-disp.coolkit.cc is the cloud platform serving the European region.


We ran different tests, and we noticed that during the pairing process everyone near the WiFi soft AP can retrieve the device_id parameter, since it is part of the device softAP WiFi SSID.
To retrieve a particular device secret-key you just need:
- a valid user account registered on the eWeLink platform. 
- the device_id parameter.

As a consequence, just by knowing a device id, the corresponding device secret key can be easily retrieved.
This enables a nearby malicious user to grab the user’s WiFi credentials by eavesdropping on the configuration message transmitted by the user’s smartphone to the IoT device. Note that, the device softAP Wifi is open and unprotected by default, so eavesdropping is possible.

After retrieving the secret key from the cloud services (together with the already known device_id parameter), the malicious user could decrypt the configuration message and extract the user’s WiFi credentials.
As a consequence, the customer's full home network is compromised.


# Tested Versions
 This vulnerability has been tested with the Android (v4.11.0 and earlier) and iOS (v4.9.1 and earlier) versions of the *eWeLink* mobile application.

# Disclosure Timeline
- Feb 25, 2021: Report submitted to Coolkit, the company behind eWeLink.
- Mar 02, 2021: No acknowledgement received, second report submitted to Coolkit.
- Mar 04, 2021: Received acknowledgement from Coolkit CTO, with a temporary mitigation before API re-design.
- Apr 08, 2021: Disclosing the vulnerability @ITASEC2021 Conference [1]
- May 03, 2021: Publishing the CVE-2021-27941 ref.

# References
[1] Daniele Granata, and Massimiliano Rak, and Giovanni Salzillo, and Umberto Barbato. "Security in IoT Pairing & Authentication protocols, a Threat Model and a Case Study Analysis", ITASEC 2021.

License
----

MIT
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →