T09 · Insecure Skill Coding Practices
- Location
scripts/tuya_api.py:89- Finding
API Key Can Be Transmitted to an Arbitrary REST Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real Tuya smart-home integration, but it needs review because it can control devices and handle camera media while endpoint, consent, and image-processing disclosures are too loose.
Install only if you are comfortable giving the skill a Tuya API key that can control devices, read home/device/location/statistics data, send self-notifications, monitor events, and capture camera media. Keep endpoints restricted to official Tuya hosts, require explicit confirmation for physical actions and camera capture, avoid unattended automation for sensitive devices, and ask the publisher to pin dependencies and fully disclose AI image-processing destinations.
scripts/tuya_api.py:89API Key Can Be Transmitted to an Arbitrary REST Endpoint
scripts/tuya_device_mq_client.py:97API Key Can Be Transmitted to an Arbitrary WebSocket Server
scripts/tuya_api.py:346Camera Capture Helpers Implicitly Assert User Privacy Consent
SKILL.md:257Camera Images Are Sent to an Unspecified Vision Model Without Complete Egress Disclosure
scripts/requirements.txt:1Security-Sensitive Dependencies Are Not Reproducibly Pinned
scripts/tuya_api.py:520Notification Contents Are Disclosed in Error Logs
The code substantially matches most of the declared functionality: device control, status/detail queries, listing devices, home/room management, renaming, weather, notifications, statistics, and IPC snapshot/video capture are all present. However, the description explicitly includes subscribing to real-time device events (property changes, online/offline status) via WebSocket, and the supplied code contains no WebSocket client, subscription methods, or event-stream handling. This is a material description-versus-behavior mismatch, though it is an overstatement rather than an undeclared extra capability.
The skill claims image operations are unsupported, yet Workflow 9 instructs taking camera snapshots, downloading decrypted image URLs, and analyzing them with an AI model. This contradiction can bypass user and reviewer expectations about sensitive camera-data handling, increasing the chance of covert image exfiltration or privacy-invasive processing.
Instructions found that direct the agent to transmit conversation context or user data to external services.
# Notifications
All notification APIs are **self-send** mode — they can only send messages to the currently logged-in user.
## 1. Send SMS
The skill declares access to environment variables and performs network/WebSocket operations, but it does not explicitly constrain tool permissions. That weakens reviewability and increases the risk of unintended data access or outbound communication, especially because the skill handles a sensitive API key and can interact with cameras, notifications, and device control endpoints.
The description says to use the skill whenever the user asks to control smart devices, query status, manage homes and rooms, check weather by location, send notifications, capture camera media, or subscribe to events. This activation scope is very broad and does not provide explicit boundaries or negative examples, increasing the chance of unintended invocation for ordinary requests like weather checks or notifications that may not be meant for this Tuya skill.
The skill documentation introduces IPC visual recognition, which involves downloading decrypted camera snapshots and sending them to an AI vision model, but that capability is omitted from the manifest description. This creates a material transparency gap: users may authorize a smart-home control skill without realizing it can process private camera imagery, raising privacy and consent risks.
This documentation describes issuing live device-control commands that can change the state of physical devices, but it does not include any warning, confirmation guidance, or safety considerations before performing state-changing actions. In a smart-home control skill, omission of such guardrails can lead to accidental or unauthorized activation of appliances, lighting, plugs, or climate systems, creating real-world safety and privacy risks.
The documentation encourages real-time monitoring of device property and online/offline events, which can reveal occupancy, routines, and other sensitive household activity patterns. While this is expected functionality for a smart-home integration, the lack of any privacy warning, retention guidance, or access-control considerations makes it easier for downstream users to collect and expose sensitive behavioral data without realizing the risk.
The automation example performs a physical action on a device when a sensor event occurs, but it does not explicitly warn that example code can affect real-world devices and environments. In a smart-home context, state changes can have safety, security, nuisance, or cost implications if copied blindly or adapted to more sensitive devices, especially when triggered automatically from noisy or spoofed events.
This documentation enables capture and retrieval of camera snapshots/videos, which are highly privacy-sensitive, but the warning about consent appears later in the document rather than as an upfront gating requirement. In the context of a natural-language smart-home control skill, this increases the risk that an agent or integrator could implement covert or insufficiently consented surveillance flows using decrypted media URLs.
The file explicitly states that w.condition.0 is an English description and repeats that w.condition is an English-only weather condition description. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation, and this documentation does not offer any language choice or explain a necessary regional constraint.
The IPC capture helpers can trigger camera snapshots and videos and, by default, set user_privacy_consent_accepted to True when no explicit value is provided. In the context of a natural-language smart home control skill, this creates a real privacy risk because an agent or caller could collect sensitive in-home camera data without a clear user-facing confirmation or friction at the point of action.
The monitoring workflow activates on phrases like "monitor device changes in real time" or "watch for property updates," which are generic enough to match many non-Tuya contexts. The document does not state limiting conditions such as requiring an existing Tuya device scope or explicit Tuya context before activation.
This markdown file documents an operation that changes a device's custom name, which affects user-managed device metadata. The description presents the action plainly but does not include any warning or note that the operation updates persisted device information.
This markdown file documents APIs that return a user's full device inventory, room/home associations, and current device property states such as presence-related or behavioral signals. The description does not include any user warning or privacy note about accessing potentially sensitive household/device metadata, which falls under missing warnings for markdown files.
The markdown describes returning precise home latitude and longitude values and suggests reusing them for another API, but it does not include any warning that this is sensitive location data. For a skill/reference document, location-related behavior can affect user privacy and should be disclosed clearly.
This documentation states that hourly statistics for all devices under the current user are queried and that user identity is automatically obtained from the login context, but it does not include any user-facing warning about accessing potentially sensitive usage data. For markdown files, SQP-2 applies when the skill description omits warnings about behavior that could affect user data or privacy.
requests is constrained only to a broad version range, so it is not possible to verify from this manifest whether deployment will select a version affected by known CVEs. Because this skill likely performs authenticated outbound API calls to Tuya services, unresolved dependency versions can expose it to credential leakage, TLS/verification issues, or other client-side flaws if an affected release is installed.
The dependency websockets>=12.0 is not fully pinned, so builds may resolve to different versions over time, including newly introduced vulnerable or breaking releases. In a smart-home control skill that may maintain persistent WebSocket connections for real-time device events, supply-chain drift and unreviewed upgrades increase the risk of denial of service or exposure to library-level flaws.
requests>=2.28.0,<3.0.0
websockets>=12.0
websockets is also left unpinned, making it impossible to determine whether the installed version is affected by published vulnerabilities. Given the skill advertises WebSocket-based real-time device event subscriptions, a vulnerable websockets release could increase exposure to denial-of-service or protocol-handling weaknesses in a component central to its functionality.
No suspicious patterns detected.