Back to skill

Security audit

Home Assistant

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate Home Assistant skill, but it needs review because it grants broad smart-home control and handles long-lived credentials without enough safety guardrails.

Review this skill before installing. Use a dedicated least-privilege Home Assistant account/token, prefer HTTPS/wss only, restrict local config file permissions, avoid sending sensitive room or occupancy data to external webhooks, and require explicit confirmation before running services that affect locks, alarms, garage doors, covers, climate, scripts, or automations.

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

Warning
Location
scripts/ha.sh:20
Finding

Long-Lived Home Assistant Bearer Token Can Be Transmitted over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: scripts/ha.sh:20-22; insecure configuration documented at SKILL.md:23-28
Vulnerability Type: Plaintext transmission of sensitive authentication credentials
Risk Level: Medium

The documented environment-variable configuration explicitly permits an http:// Home Assistant endpoint:

bash
### Option 2: Environment Variables

```bash
export HA_URL="http://homeassistant.local:8123"
export HA_TOKEN="your-long-lived-access-token"
text

The API wrapper subsequently sends the long-lived token in every request without checking whether TLS is enabled:

```bash
api() {
  curl -s -H "Authorization: Bearer $HA_TOKEN" -H "Content-Type: application/json" "$@"
}

Technical Analysis

A bearer token grants access to any party possessing it. When HA_URL uses HTTP, the Authorization: Bearer header is transmitted without transport encryption. The script accepts this configuration without rejection or warning and attaches the token to all API requests.

An attacker with visibility or control over the network path—such as an adversary on the same wireless network, a compromised router, or a malicious network administrator—could intercept the request and recover the token. A network-positioned attacker could also modify plaintext requests or responses.

This issue does not independently escalate privileges beyond those assigned to the Home Assistant token. Its severity depends on the network environment and the permissions of the account that generated the token.

Attack Path

  1. A user follows the documented example and sets HA_URL to an http:// endpoint.
  2. The user invokes a command such as ha.sh info, ha.sh state, or a device-control operation.
  3. scripts/ha.sh sends the long-lived token in the plaintext HTTP Authorization header.
  4. An attacker monitoring or controlling the network path captures the request and extracts the token.
  5. The ...[truncated 1002 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require https:// endpoints by default and terminate with an explicit error when HA_URL begins with http://.
  2. If plaintext HTTP must be supported for isolated development environments, require an explicit opt-in variable such as HA_ALLOW_INSECURE_HTTP=1 and display a prominent warning.
  3. Replace the HTTP example in SKILL.md with an HTTPS URL and clearly document that bearer tokens must not be sent over untrusted plaintext networks.
  4. Configure Home Assistant with a valid TLS certificate or place it behind a trusted TLS-terminating reverse proxy.
  5. Use a dedicated, least-privileged Home Assistant account where deployment constraints permit, limiting the consequences of token compromise.
  6. Revoke and replace any token that may previously have been transmitted over an untrusted HTTP connection.
  7. Consider validating the URL before every request so an altered environment or configuration file cannot silently downgrade transport security. For example:
bash
if [[ "$HA_URL" != https://* ]]; then
  if [[ "${HA_ALLOW_INSECURE_HTTP:-0}" != "1" ]]; then
    echo "Error: HA_URL must use HTTPS." >&2
    exit 1
  fi
  echo "Warning: transmitting the Home Assistant token over insecure HTTP." >&2
fi
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description frames the skill as controlling Home Assistant devices and receiving webhooks, but the documented generic ha.sh call <domain> <service> <json> enables arbitrary Home Assistant service invocation, which is much broader and can affect locks, alarms, garage doors, scripts, or other sensitive entities. The claimed inbound webhook support is also only described, not implemented here, which can mislead reviewers about the actual trust and data-flow boundaries.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

export HA_TOKEN="your-long-lived-access-token"

text

### Getting a Long-Lived Access Token

1. Open Home Assistant → Profile (bottom left)
2. Scroll to "Long-Lived Access Tokens"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 33)May include surrounding context.

md
### Getting a Long-Lived Access Token

1. Open Home Assistant → Profile (bottom left)
2. Scroll to "Long-Lived Access Tokens"
3. Click "Create Token", name it (e.g., "Clawdbot")
4. Copy the token immediately (shown only once)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ha.sh (reported line 163)May include surrounding context.

sh
Environment:
  HA_URL    Home Assistant URL (required)
  HA_TOKEN  Long-lived access token (required)

Examples:
  ha.sh on light.living_room 200

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill uses shell-based capabilities (curl, jq, and a referenced ha.sh wrapper) but does not declare any explicit tool scope or permissions boundaries. In an agent environment, missing scope declarations increase the chance that the skill can be invoked with broader-than-expected execution privileges or without adequate user awareness.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The recommended configuration stores the Home Assistant URL and long-lived token in a plaintext file under the user's home directory, but the documentation does not mention restrictive file permissions or safer secret storage. If local users, backups, logs, or other processes can read that file, the token could be reused to control sensitive smart-home functions.

Content

Scanner excerpt · SKILL.md (reported line 15)May include surrounding context.

Option 1: Config File (Recommended)

Create ~/.config/home-assistant/config.json:

json
{
  "url": "https://your-ha-instance.duckdns.org",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

Get Entity State

bash
curl -s -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/states/light.living_room"

Control Devices

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation encourages triggering scripts, automations, scenes, and generic services without warning that these actions can produce physical-world effects such as unlocking doors, opening covers, disabling alarms, or running unsafe automations. In a smart-home context, omission of safety warnings materially increases the risk of accidental harmful or destructive actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The webhook section instructs users to send event data from Home Assistant to an external Clawdbot endpoint without disclosing privacy implications or data-sharing risks. Even seemingly simple events like motion and area names can reveal occupancy patterns, room usage, and other sensitive household information when transmitted off-box.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The authentication section introduces a long-lived access token in a copyable header example without stating that it is a sensitive credential with broad control over the Home Assistant instance. In this skill context, token leakage could grant an attacker the ability to read states, invoke services, and control connected smart-home devices.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The reference documents multiple state-changing actions with real-world effects, including lights, climate, media players, covers, and notifications, without any caution that these operations can affect physical devices and should require deliberate user intent. In a home automation skill, this omission can normalize unsafe use of commands like opening a garage or changing climate settings, increasing the risk of accidental or unauthorized real-world actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The webhook section explains how to trigger automations via /api/webhook/<webhook_id> but does not warn that possession of the webhook ID may be sufficient to invoke automations if exposed. Because this skill is explicitly designed for bidirectional communication with Home Assistant, undocumented webhook security expectations can lead to unauthorized triggering of sensitive automations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The call command allows arbitrary Home Assistant domain/service invocation with attacker-controlled JSON payloads, which goes beyond the narrower smart-home control operations described elsewhere in the skill. In practice, a user or downstream agent can use this single entry point to invoke any HA-exposed service, including sensitive integrations, admin-like actions, notifications, locks, alarms, cameras, or custom services, substantially expanding the skill's authority and attack surface.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The WebSocket example uses ws://ha-url/api/websocket, which implies an unencrypted channel and may lead implementers to send access tokens over plaintext connections. If used outside a strictly local trusted environment, this exposes authentication material and event data to interception or manipulation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.