Back to skill

Security audit

Home Assistant Assist

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it gives an agent broad smart-home control using a long-lived token and an unsafe shell command pattern that needs review before installation.

Review this skill before installing. Use a dedicated Home Assistant token with the least access available, protect the OpenClaw config file, prefer HTTPS for HASS_SERVER, and avoid using it for locks, alarms, garage doors, or other high-risk devices unless you add confirmation and safe request serialization.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:27
Finding
Shell Command Injection Through Unsafe User Request Interpolation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:27-30` **Vulnerability Type**: Shell command injection caused by unsafe interpolation of user-controlled input **Risk Level**: High ### Vulnerable Code ```bash curl -s -X POST "$HASS_SERVER/api/conversation/process" \ -H "Authorization: Bearer $HASS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"text": "USER REQUEST HERE", "language": "en"}' ``` ### Technical Analysis The skill instructs the agent to place the user's natural-language request directly into a single-quoted shell argument. It does not require a JSON-aware serializer or define a safe mechanism for passing the request to the command. If `USER REQUEST HERE` is replaced through direct textual substitution, an input containing a single quote can terminate the shell argument. The remaining input can then introduce shell operators and arbitrary commands. Escaping for JSON alone is insufficient because shell quoting and JSON encoding are separate security boundaries. The risk is amplified because the command runs in the OpenClaw environment and has access to the long-lived Home Assistant bearer token through `HASS_TOKEN`. ### Attack Path 1. An attacker supplies a smart-home request containing a single quote followed by shell syntax and an operating-system command. 2. The agent substitutes that request directly into the documented `curl` command in place of `USER REQUEST HERE`. 3. The single quote closes the intended `--data` shell argument. 4. Shell metacharacters in the remaining input cause the injected command to be parsed separately. 5. The injected command executes with the same operating-system identity and permissions as the OpenClaw process. 6. The attacker may use this access to read environment variables, disclose `HASS_TOKEN`, modify accessible files, or execute further local actions. Exploitation depends on the agent or runtime implementing the documented placeholder through unsafe shell-text substitution. A ...[truncated 938 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Do not insert user-controlled text into a shell command template. Construct the request body with a JSON-aware encoder and pass it as a quoted variable without evaluation. For example: ```bash payload=$(jq -n \ --arg text "$USER_REQUEST" \ --arg language "en" \ '{text: $text, language: $language}') curl -sS -X POST "$HASS_SERVER/api/conversation/process" \ -H "Authorization: Bearer $HASS_TOKEN" \ -H "Content-Type: application/json" \ --data-binary "$payload" ``` Apply the following hardening measures: 1. Pass the request through a positional argument, environment variable, standard input, or structured command API rather than textual command substitution. 2. Use a JSON serializer such as `jq` or an equivalent language library to encode all request fields. 3. Explicitly prohibit `eval`, `sh -c`, dynamically generated shell scripts, and direct replacement of placeholders inside command strings. 4. Prefer an implementation in which the process executable and arguments are passed as an argument array without invoking a shell. 5. Validate that `HASS_SERVER` uses an expected HTTPS origin and is not derived from untrusted request content. 6. Use a dedicated Home Assistant token with the minimum permissions available, and rotate the token if command injection or token exposure is suspected. 7. Add tests containing single quotes, double quotes, command substitutions, newlines, and shell metacharacters to verify that they remain literal JSON data. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Credential Access

High
Category
Privilege Escalation
Content
- [OpenClaw](https://github.com/openclaw/openclaw) installed and running
- Home Assistant instance with API access
- A [Long-Lived Access Token](https://developers.home-assistant.io/docs/auth_api/#long-lived-access-token) from Home Assistant

## Installation
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
1. Open Home Assistant
2. Click your profile (bottom left)
3. Scroll to **Long-Lived Access Tokens**
4. Click **Create Token**
5. Give it a name (e.g., "OpenClaw")
6. Copy the token immediately (it won't be shown again!)
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
1. Open Home Assistant
2. Click your profile (bottom left)
3. Scroll to **Long-Lived Access Tokens**
4. Click **Create Token**
5. Give it a name (e.g., "OpenClaw")
6. Copy the token immediately (it won't be shown again!)
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The README instructs users to place a long-lived Home Assistant token directly into a local configuration file without any warning about credential sensitivity, least-privilege, filesystem protections, or secret-management practices. Because this token can control smart home devices and query home state, accidental exposure through backups, screenshots, shared configs, or weak file permissions could enable unauthorized access to the user's Home Assistant environment.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill is designed to trigger real smart-home actions but explicitly promotes a 'fire and forget' model without requiring a confirmation or warning before sending control commands. In this context, natural-language home automation can unlock doors, disable alarms, or manipulate safety-relevant devices, so lack of a warning/confirmation increases the chance of unintended or unsafe actions.

External Transmission

Medium
Category
Data Exfiltration
Content
Pass the user's request directly to Assist:

```bash
curl -s -X POST "$HASS_SERVER/api/conversation/process" \
  -H "Authorization: Bearer $HASS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "USER REQUEST HERE", "language": "en"}'
Confidence
91% confidence
Finding
The skill forwards raw user requests to an external Home Assistant server along with a bearer token, which is an external transmission of potentially sensitive home-behavior data. In this context the transmission is core to the skill's purpose, but it still carries privacy and security risk because user utterances may reveal occupancy, routines, device names, or security-sensitive intents.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The skill hard-codes the request language to English when forwarding user commands to Home Assistant. This can cause misinterpretation of non-English or multilingual requests, and in a smart-home control context, intent confusion can result in the wrong physical device being operated or an action occurring contrary to user expectation.

Scope Creep

Low
Category
Excessive Agency
Content
## [1.0.1] - 2026-02-07

### Changed
- Simplified skill philosophy: "fire and forget" — trust Assist to handle everything
- Removed over-engineered response parsing guidance
- Errors from Assist are now framed as HA config suggestions, not skill failures
- Streamlined documentation
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The request schema example specifies `"language": "en"` as the fixed value, which signals that the skill is intended to operate only in English. Without user opt-in or documentation explaining the locale restriction, this conflicts with the language/locale policy guidance.

Static analysis

No suspicious patterns detected.