T09 · Insecure Skill Coding Practices
- Location
config.json:3- Finding
Long-Lived Home Assistant Token Transmitted over Plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This smart-home skill is mostly a Home Assistant integration, but it under-discloses device-control automation and encourages insecure handling of a powerful Home Assistant token.
Review this carefully before installing. Use HTTPS only, restrict the Home Assistant token to the minimum possible permissions, rotate any token previously used over HTTP, and do not enable the control or scenario handlers unless you are comfortable with the skill changing lights, curtains, and other devices without its own confirmation layer.
config.json:3Long-Lived Home Assistant Token Transmitted over Plaintext HTTP
manifest.json:14Unbounded Third-Party Dependency Versions
The documentation frames the skill as monitoring and suggestions, while the behavior reportedly includes active automation and multi-step scene execution such as arrival or bedtime routines. Hidden automation capability can trigger broad real-world changes from a seemingly low-risk skill, making the mismatch especially dangerous in a home environment with physical devices.
The documentation frames the skill as monitoring and suggestions, while the behavior reportedly includes active automation and multi-step scene execution such as arrival or bedtime routines. Hidden automation capability can trigger broad real-world changes from a seemingly low-risk skill, making the mismatch especially dangerous in a home environment with physical devices.
The documentation frames the skill as monitoring and suggestions, while the behavior reportedly includes active automation and multi-step scene execution such as arrival or bedtime routines. Hidden automation capability can trigger broad real-world changes from a seemingly low-risk skill, making the mismatch especially dangerous in a home environment with physical devices.
The documentation frames the skill as monitoring and suggestions, while the behavior reportedly includes active automation and multi-step scene execution such as arrival or bedtime routines. Hidden automation capability can trigger broad real-world changes from a seemingly low-risk skill, making the mismatch especially dangerous in a home environment with physical devices.
The code can issue Home Assistant service calls that actively control devices, but the skill metadata describes only monitoring, status queries, alerts, and advice. This capability mismatch is dangerous because users or reviewers may grant the skill trust and secrets under a read-only expectation while the code can perform physical actions such as toggling lights or curtains.
该技能说明全文使用中文,且没有说明这是面向中文用户的区域性技能,也没有提供语言切换或用户选择。按规则,若技能强制特定语言而无用户选择或明确合理的区域限定,可构成自然语言策略违规。
The skill documentation defines operational capabilities and required files, but it does not declare an explicit tool scope such as permissions or allowed-tools. In a skill that reads local files and makes HTTP requests to Home Assistant, missing scope declarations weakens least-privilege controls and can cause users or runners to underestimate what the skill can access.
The documentation includes examples like turning on devices but does not warn that the skill can cause real-world state changes in the home. Without safety messaging or confirmation requirements, users may issue commands casually and unintentionally affect power-consuming or safety-relevant devices.
This JSON manifest defines natural-language command mappings such as light and curtain names, but it does not specify what exact trigger phrases activate the skill or what phrases should not. Without clear activation constraints or negative examples, ordinary household language referring to these devices could ambiguously invoke the skill.
The natural-language command keys are exclusively in Chinese, which suggests the skill expects a specific language/locale for operation. There is no accompanying indication of user opt-in, multilingual support, or justification that the skill is intentionally region-specific.
The code reads a sensitive credential from configuration and uses it in Authorization headers for outbound requests. There is no confirmation prompt, logging, comment warning, or other user disclosure indicating that credentials and home-environment data will be sent over the network.
The top-level docstring and later method docstring emphasize a 'safe silent monitoring handler' that does not write files and only returns in-memory results. In practice, the code performs disk reads for configuration and actively fetches multiple device states from Home Assistant, including a door lock, which goes beyond the narrow implication of purely in-memory handling. The documentation is therefore materially misleading about what the code actually does.
The manifest claims that all data processing is completed in memory and that sensitive information is not persisted. However, this code explicitly loads Home Assistant configuration, including a token used later for API access, from a JSON file on disk. That is a meaningful behavior mismatch because the implementation depends on persisted sensitive configuration rather than purely in-memory handling.
This code performs multiple authenticated network requests to a Home Assistant server and retrieves sensitive smart-home data such as door-lock and occupancy-related device states. Although the module has internal comments/docstrings, it lacks any user-facing warning, confirmation, or visible notice that household telemetry is being queried and transmitted over the network.
The module docstring explicitly says it handles natural language commands for smart home control, which contradicts the monitoring-only description in the skill metadata. This inconsistency is a security-relevant transparency issue because it obscures the true behavior of the skill and makes dangerous capabilities easier to hide in plain sight.
The skill loads a Home Assistant bearer token and prepares authenticated headers for API use without any visible disclosure, consent flow, or privilege scoping in this file. In the context of a smart-home skill, silent use of a powerful automation token increases risk because compromise or misuse can expose device state and enable unauthorized actions across the home environment.
The code sends authenticated HTTP requests containing entity identifiers and service commands to Home Assistant without any explicit user-facing notice in the implementation context provided. While communication with Home Assistant is expected for this type of skill, undisclosed transmission of device identifiers and control requests is still security-sensitive because it involves private home topology and potentially safety-affecting actions.
This code performs external network transmission to a Home Assistant API endpoint, including authenticated headers and JSON command data. External transmission is expected for an integration skill, but it remains security-relevant here because the payload can trigger physical device actions and expose device identifiers; combined with the manifest mismatch, the transmission is more dangerous than ordinary telemetry.
data.update(kwargs)
try:
response = requests.post(url, headers=self.headers, json=data, timeout=10)
return response.status_code == 200
except Exception as e:
print(f"Error executing service: {e}")
The natural-language command mappings are exclusively Chinese phrases, which imposes a specific language requirement on users. There is no opt-in, fallback, or documentation indicating that this is intentionally limited to a Chinese-language environment.
The skill metadata says it provides monitoring, status queries, and smart suggestions, but this code performs authenticated Home Assistant service calls that directly change device state. That mismatch is risky because users or reviewers may grant trust expecting passive observation while the skill can actively operate switches and covers.
execute_service() issues authenticated state-changing requests without any built-in confirmation, warning, or policy check. In a smart-home setting, silent execution can trigger unintended device operations, especially if upstream intent parsing is wrong or the call path is abused.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
data.update(kwargs)
try:
response = requests.post(url, headers=self.headers, json=data, timeout=10)
return response.status_code == 200
except Exception as e:
print(f"Error executing service: {e}")
The scenario methods do more than provide recommendations: they automatically turn devices on or off and move covers. In a home-automation context, undisclosed actuation expands the skill's authority and can surprise users, causing privacy, safety, or operational issues.
This scenario performs an immediate actuator command and only informs the user after the fact. In a physical environment, post-action messaging removes the user's chance to prevent an unintended change and increases risk from accidental or misinterpreted triggers.
The natural-language content of the skill file is fully Chinese, and there is no indication that users can choose another language or that the locale restriction is intentional and documented as a region-specific constraint. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.