Credential Access
- Category
- Privilege Escalation
- Confidence
- 85% confidence
- Finding
The skill explicitly tells the user to obtain cloud API credentials and device local keys, then store/export them and write them into
tuya_devices.json. These are highly sensitive secrets: exposure would allow unauthorized querying of the Tuya cloud project and direct local control of enrolled devices on the LAN.- Content
md 2. **Find the device on the LAN.** Optional but the fastest way to learn the IP and the protocol version. Run `python -m tinytuya scan` (or `tinytuya.deviceScan()`), or read the device list from your router's DHCP leases. Completion: you have an IP for the device. Devices are often at a fixed DHCP lease, but the IP can change — re-check before blaming the code. 3. **Fetch device ids + local keys from the cloud (one time).** Create a free **Tuya IoT Platform** project, enable **IoT Core**, and link your Smart Life / Tuya app account to it (Devices → Link App Account). Note the project's **Access ID / Client ID** and **Access Secret / Client Secret**, plus the region (`eu`, `us`, `cn`, `in`). Put them in environment variables and run the bundled `scripts/fetch_keys.py`. Completion: `tuya_devices.json` exists and lists at least one device with a local key. 4. **Probe the device locally.** Run `scripts/local_status.py <name-or-id>`. It opens a `tinytuya.Device` with the stored id + key + IP and calls `status()`. If it fails, try the other protocol version (`3.3` vs `3.4`) — this is the single most common cause of an empty or refused response. Completion: you get a JSON blob of DPS values.
