T09 · Insecure Skill Coding Practices
- Location
scripts/homeassistant-cli.py:12- Finding
Long-Lived Home Assistant Bearer Token Can Be Transmitted over Plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Home Assistant skill is not clearly malicious, but it handles powerful smart-home access in ways that deserve review before installation.
Install only if you are comfortable giving this skill broad Home Assistant authority. Use HTTPS, avoid passing tokens or alarm codes on the command line, prefer a dedicated least-privilege Home Assistant token, and treat service, template, presence, tracker, lock, alarm, garage, and Tesla location commands as sensitive actions requiring explicit user intent.
scripts/homeassistant-cli.py:12Long-Lived Home Assistant Bearer Token Can Be Transmitted over Plaintext HTTP
scripts/homeassistant-cli.py:469Authentication Secrets Are Accepted and Documented as Command-Line Arguments
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
body = json.dumps(data).encode() if data is not None else None
req = urllib.request.Request(url, data=body, headers=headers, method=method)
try:
with urllib.request.urlopen(req) as resp:
content = resp.read().decode()
if content:
return json.loads(content)
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
body = json.dumps(data).encode() if data is not None else None
req = urllib.request.Request(url, data=body, headers=headers, method=method)
try:
with urllib.request.urlopen(req) as resp:
content = resp.read().decode()
if content:
return json.loads(content)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## Setup
1. Get a long-lived access token from Home Assistant (Profile → Long-Lived Access Tokens)
2. Configure via environment variables or command-line arguments:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## Setup
1. Get a long-lived access token from Home Assistant (Profile → Long-Lived Access Tokens)
2. Configure via environment variables or command-line arguments:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## Setup
1. Get a long-lived access token from Home Assistant (Profile → Long-Lived Access Tokens)
2. Configure via environment variables or command-line arguments:
The documented behavior goes far beyond a simple device-control CLI: it includes broad household discovery, presence and location lookups, template evaluation, history/logbook access, notifications, TTS, and Tesla-specific entity access. This scope expansion increases both privacy risk and operational risk because a user expecting basic control may unknowingly grant a tool access to sensitive telemetry and powerful automation surfaces.
The generic service command allows arbitrary Home Assistant service invocation with attacker-controlled JSON. In a Home Assistant environment, that can trigger sensitive actions well beyond simple device toggling, including locks, alarms, notifications, scripts, admin-like automations, and other integrations accessible to the token.
Arbitrary template evaluation exposes a powerful Home Assistant/Jinja introspection surface that can enumerate entities, metadata, areas, devices, and other sensitive state not implied by a simple control CLI. Depending on Home Assistant capabilities, templates may also be abused to access extensive contextual data and facilitate reconnaissance for later actions.
The Tesla location and destination commands return precise latitude and longitude without friction, which can reveal real-time or intended vehicle location. In skill context, this is especially dangerous because it enables direct physical tracking of a person or household asset, far beyond normal device control expectations.
The README explicitly instructs users to pass a long-lived Home Assistant token on the command line. Command-line arguments are commonly exposed through shell history, process listings, audit logs, and system monitoring tools, which can leak the token to other local users or logging systems. In the context of a home automation CLI, a stolen token could allow broad control over devices, alarms, locks, and other sensitive automations.
The skill declares environment and network capabilities in metadata but does not define an explicit tool/permission scope, reducing transparency about what runtime powers it needs. In a home-automation context, undeclared or overly broad capability use matters because the skill can read sensitive household state and invoke state-changing actions over the Home Assistant API.
The skill exposes occupancy and tracker-based presence information, which can reveal whether people are home and may expose location-derived data. In a smart-home context this is privacy-sensitive and can materially aid stalking, burglary timing, or other misuse if invoked without clear user awareness and consent.
The generic service-call interface can invoke essentially any Home Assistant service with arbitrary JSON, bypassing the narrower safety guidance provided for specific high-risk domains like locks, alarms, and garage doors. In practice, this becomes a universal state-changing primitive that could disable security automations, unlock doors, open covers, or trigger dangerous household actions without any built-in confirmation or policy restriction.
The skill description frames the tool as a small device-control CLI, but the implementation includes broad surveillance and introspection features such as presence, calendars, history, logbook, weather, services, and template execution. That scope expansion increases the chance a user grants trust or tokens under a narrower mental model than the code actually warrants.
The presence command prints person and device_tracker states directly, exposing occupancy and movement information without any warning or scoping. In a household context, this is sensitive telemetry that can reveal who is home, away patterns, and indirectly daily routines.
The Tesla-specific commands embed personalized vehicle tracking capabilities inside a general-purpose Home Assistant CLI, including location and destination retrieval. This materially expands the data sensitivity of the tool and introduces targeted privacy risk unrelated to its advertised generic smart-home control role.
No suspicious patterns detected.