Back to skill

Security audit

Workswith Claw

Security checks for vulnerabilities and agentic risk

Overview

This smart-home skill is coherent with its purpose, but it exposes home data and automation controls with insufficient authentication and unsafe credential handling.

Review carefully before installing. Only run this on a trusted, firewalled host; require authentication before exposing any API or dashboard; avoid host networking unless necessary; use HTTPS to Home Assistant; rotate any HA token entered into the dashboard; and treat occupancy, device inventory, and automation creation as administrator-only capabilities.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (7)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/main.py:29
Finding
Missing Authentication Across Sensitive and State-Changing APIs<![CDATA[ ## Vulnerability Details **File Location**: `src/main.py:29-38`, `src/core/auth.py:15-39` **Vulnerability Type**: Missing authentication and fail-open authorization **Risk Level**: Critical ### Vulnerable Code ```python app.include_router(health.router, prefix="/api/v1", tags=["health"]) app.include_router(intent.router, prefix="/api/v1", tags=["intent"]) app.include_router(scenes.router, prefix="/api/v1", tags=["scenes"]) app.include_router(insights.router, prefix="/api/v1", tags=["insights"]) app.include_router(suggestions.router, prefix="/api/v1", tags=["suggestions"]) app.include_router(dashboard.router, prefix="/api/v1", tags=["dashboard"]) app.include_router(apply.router, prefix="/api/v1", tags=["apply"]) app.include_router(devices.router, prefix="/api/v1", tags=["devices"]) app.include_router(semantic.router, prefix="/api/v1", tags=["semantic"]) app.include_router(insights2.router, prefix="/api/v1", tags=["insights2"]) ``` ```python async def verify_api_key(api_key: str = Security(api_key_header)) -> str: """验证 API Key""" # 如果没配置 API Key,跳过验证 if not API_KEY: return "dev" # 验证 if not api_key: raise HTTPException( status_code=401, detail="请提供 API Key" ) if api_key != API_KEY: raise HTTPException( status_code=403, detail="API Key 无效" ) return api_key def require_auth(): """认证依赖""" return Depends(verify_api_key) ``` ### Technical Analysis An API-key verification function exists, but none of the application routers or individual endpoints apply `require_auth()` or `verify_api_key`. Consequently, every route is accessible without authentication. The authentication implementation also fails open when `WORKSWITH_CLAW_API_KEY` is empty. This is particularly dangerous because the documented launch command binds the application to `0.0.0.0`, and the Docker configuration leaves the API key empty while using host ...[truncated 1267 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Apply authentication globally to all routes except a deliberately minimal health endpoint. - Configure router dependencies, for example: ```python app.include_router( devices.router, prefix="/api/v1", dependencies=[Depends(verify_api_key)] ) ``` - Fail closed during startup if no API key or equivalent authentication mechanism is configured. - Use constant-time secret comparison with `secrets.compare_digest`. - Introduce authorization roles separating read-only monitoring from device control and automation management. - Bind to `127.0.0.1` by default and require an explicit setting for network-wide exposure. - Place the service behind an authenticated HTTPS reverse proxy. - Add request rate limiting, security logging, and CSRF protection if browser sessions are introduced. - Remove `network_mode: host` unless it is strictly required. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/api/routes/devices.py:18
Finding
Unauthenticated Disclosure of Complete Home Assistant Entity State<![CDATA[ ## Vulnerability Details **File Location**: `src/api/routes/devices.py:18-67` **Vulnerability Type**: Sensitive household-state exposure **Risk Level**: High ### Vulnerable Code ```python def get_ha_headers(): return {"Authorization": f"Bearer {HA_TOKEN}"} async def fetch_all_states(): """获取所有实体状态""" if not HA_TOKEN: return [] try: async with httpx.AsyncClient(timeout=10) as client: resp = await client.get(f"{HA_URL}/api/states", headers=get_ha_headers()) if resp.status_code == 200: return resp.json() except: pass return [] @router.get("/devices") async def get_devices(): """获取设备列表(按类型分组)""" states = await fetch_all_states() if not states: return {"devices": [], "error": "未连接 HA", "groups": {}} groups = {} for s in states: entity_id = s.get("entity_id", "") domain = entity_id.split(".")[0] if "." in entity_id else "unknown" state = s.get("state", "unknown") if domain not in groups: groups[domain] = {"count": 0, "online": 0, "devices": []} groups[domain]["count"] += 1 if state != "unavailable": groups[domain]["online"] += 1 groups[domain]["devices"].append({ "entity_id": entity_id, "state": state, "attributes": s.get("attributes", {}) }) return { "devices": states, "total": len(states), "groups": groups } ``` ### Technical Analysis The endpoint retrieves all Home Assistant entity states with a privileged long-lived token and then returns the unfiltered `states` collection to the caller. It additionally returns each entity's complete attributes through grouped results. Home Assistant attributes can contain friendly names, room identifiers, device metadata, integration details, media state, sensor readings, and other information that ...[truncated 1140 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Require authentication and read authorization for `/devices`. - Do not return the raw `states` response. - Construct a strict response schema containing only fields needed by the dashboard. - Exclude sensitive domains such as `person`, `device_tracker`, alarm, lock, camera, and security sensors unless explicitly requested by an authorized user. - Remove arbitrary Home Assistant attributes from responses or allowlist individual safe attributes by domain. - Add audit logs for inventory access. - Consider separate endpoints and permissions for general devices, security devices, and presence-related entities. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/api/routes/insights_v2.py:35
Finding
Public Exposure of Occupancy, Motion, and Household Activity<![CDATA[ ## Vulnerability Details **File Location**: `src/api/routes/insights_v2.py:35-131`, `src/api/routes/devices.py:71-158` **Vulnerability Type**: Occupancy and behavioral privacy disclosure **Risk Level**: High ### Vulnerable Code ```python @router.get("/insights/dashboard") async def get_insights_dashboard(): """数据洞察首页""" states = await fetch_states() people_count = 0 rooms = {"客厅": False, "卧室": False, "次卧": False, "厨房": False, "卫生间": False} for s in states: entity_id = s.get("entity_id", "") state = s.get("state") if entity_id.startswith("person."): if state == "home": people_count += 1 name = s.get("attributes", {}).get("friendly_name", "").lower() if "客厅" in name and state == "on": rooms["客厅"] = True if "卧室" in name and state == "on": rooms["卧室"] = True if "次卧" in name or "扬仔" in name: if state == "on": rooms["次卧"] = True if "厨房" in name and state == "on": rooms["厨房"] = True if "卫生间" in name or "浴室" in name: if state == "on": rooms["卫生间"] = True ``` ```python return { "home_status": { "people_count": people_count, "rooms": rooms, "text": f"{'有人' if people_count > 0 else '无人'}在家" }, "device_stats": device_stats, "activity_patterns": activity_patterns, "device_patterns": device_patterns, "insights": insights, "timestamp": datetime.now().isoformat() } ``` The area endpoint also exposes motion and entry-related sensor values: ```python if "motion" in entity_id.lower() or "presence" in entity_id.lower(): key_sensors["motion"].append({ "entity": entity_id, "name": friendly_name, "value": state }) if "door" in entity_id.lower() or "window" in entity_id.lower() or "contact" in entity_id.lower(): key_sensors["door_window"].append({ ...[truncated 1381 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Require strong authentication and explicit authorization for occupancy-related endpoints. - Treat person, motion, presence, door, and window states as a separate highly sensitive permission category. - Disable occupancy analytics by default and require informed user opt-in. - Return coarse or delayed information where real-time precision is unnecessary. - Add request rate limiting to make continuous polling more difficult. - Record and expose access logs to administrators. - Avoid publishing behavioral schedules, quiet periods, or home/away status to general dashboard users. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/api/routes/apply.py:75
Finding
Unauthenticated Persistent Home Assistant Automation Creation<![CDATA[ ## Vulnerability Details **File Location**: `src/api/routes/apply.py:75-121` **Vulnerability Type**: Unauthorized persistent automation modification **Risk Level**: Critical ### Vulnerable Code ```python def create_automation_file(insight_type: str, params: dict = None) -> dict: """创建自动化 YAML 文件""" if insight_type not in AUTOMATION_TEMPLATES: return {"success": False, "error": "未知的洞察类型"} template = AUTOMATION_TEMPLATES[insight_type].copy() if params: if "time" in params: template["trigger"][0]["at"] = params["time"] if "temperature" in params: template["action"][0]["data"]["temperature"] = params["temperature"] if "brightness" in params: template["action"][0]["data"]["brightness"] = params["brightness"] os.makedirs(AUTOMATIONS_DIR, exist_ok=True) filename = f"wc_{insight_type}.yaml" filepath = os.path.join(AUTOMATIONS_DIR, filename) with open(filepath, 'w', encoding='utf-8') as f: yaml.dump([template], f, allow_unicode=True, default_flow_style=False) return { "success": True, "file": filepath, "automation": template } @router.post("/apply") async def apply_automation(request: ApplyRequest): """采纳洞察,创建自动化""" result = create_automation_file(request.insight_type, request.params) if result["success"]: return { "success": True, "message": f"自动化已生成: {result['file']}", "file": result["file"], "automation": result["automation"], "yaml": yaml.dump([result["automation"]], allow_unicode=True, default_flow_style=False) } ``` ### Technical Analysis The `/apply` endpoint writes directly into `~/.homeassistant/automations` without authenticating the caller. A caller can select a predefined automation and provide custom `time`, `temperature`, or `brightness` values. The target filename is constrained by ...[truncated 1499 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Require an authenticated administrator role for automation creation. - Require explicit confirmation from a trusted user before activating a generated automation. - Replace the generic `params: dict` field with a strict Pydantic model. - Validate time formatting and enforce device-specific safe ranges for temperature and brightness. - Use deep copies of templates to avoid shared nested-object mutation: ```python from copy import deepcopy template = deepcopy(AUTOMATION_TEMPLATES[insight_type]) ``` - Write proposed automations to a staging area and require review before moving them into the active Home Assistant directory. - Create files with restrictive permissions. - Maintain an immutable audit log recording the authenticated user, old file hash, new file hash, and parameter values. - Provide a safe rollback mechanism. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
static/dashboard.html:481
Finding
Home Assistant Long-Lived Token Stored in Browser Local Storage<![CDATA[ ## Vulnerability Details **File Location**: `static/dashboard.html:481-484` **Vulnerability Type**: Insecure browser-side credential storage **Risk Level**: High ### Vulnerable Code ```javascript const savedToken = localStorage.getItem('ha_token'); if (savedToken) { document.getElementById('ha-token').value = savedToken; document.getElementById('ha-token').placeholder = '••••••••'; } function saveToken(input) { if (input.value) { localStorage.setItem('ha_token', input.value); input.placeholder = '••••••••'; } } ``` ### Technical Analysis The dashboard stores a Home Assistant long-lived access token in `localStorage`. Local-storage values persist across browser sessions and are readable by all JavaScript executing under the same origin. They are not protected by `HttpOnly`, and masking the input visually does not protect the underlying value. The dashboard does not send this token to the backend when testing the connection. The backend independently reads `HA_TOKEN` from its environment. Therefore, browser-side token collection does not appear necessary for the implemented connection workflow and creates credential exposure without providing the declared configuration function. ### Attack Path 1. A user pastes a privileged Home Assistant token into the dashboard. 2. The `change` handler stores the token in `localStorage`. 3. An attacker gains same-origin JavaScript execution through an unsafe HTML sink, compromised script, or malicious browser extension. 4. The attacker executes: ```javascript localStorage.getItem('ha_token') ``` 5. The attacker exfiltrates the token and uses it directly against the Home Assistant API. ### Impact Assessment Compromise of a Home Assistant long-lived token can grant broad access associated with the token owner, potentially including device state access, automation management, and physical device control. The exact privileges depend on Home Assistant's account and authorization c ...[truncated 19 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the frontend token input and local-storage persistence. - Configure `HA_TOKEN` only on the server through protected secret storage or environment injection. - Never expose the Home Assistant long-lived token to browser JavaScript. - If browser authentication is needed, use a separate application session with short-lived, narrowly scoped credentials. - Store session identifiers in cookies configured with `Secure`, `HttpOnly`, and an appropriate `SameSite` policy. - Provide a visible token-removal and credential-rotation workflow for users who used the affected dashboard. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
static/dashboard.html:460
Finding
Dashboard Cross-Site Scripting Through Unsanitized Home Assistant Data<![CDATA[ ## Vulnerability Details **File Location**: `static/dashboard.html:460-477`, `static/dashboard.html:713-735` **Vulnerability Type**: DOM-based cross-site scripting **Risk Level**: High ### Vulnerable Code ```javascript async function loadDeviceList() { try { const resp = await fetch('/api/v1/devices'); const data = await resp.json(); const groups = data.groups || {}; const order = ['light', 'climate', 'switch', 'sensor', 'binary_sensor']; const names = {'light': '💡 灯光', 'climate': '🌡️ 空调', 'switch': '🔌 开关', 'sensor': '📡 传感器', 'binary_sensor': '🚶 人体感应'}; let html = ''; for (const domain of order) { if (!groups[domain]) continue; const g = groups[domain]; html += `<div class="device-type"><div class="device-type-header"><span class="device-type-name">${names[domain] || domain}</span><span class="device-type-count">${g.count} 个</span></div><div class="device-list">`; for (const d of g.devices.slice(0, 5)) { html += `<div class="device-item"><span class="name">${d.attributes.friendly_name || d.entity_id}</span><span class="state ${d.state === 'on' ? 'on' : ''}">${d.state}</span></div>`; } if (g.devices.length > 5) html += `<div class="device-item" style="color: var(--text-secondary);">还有 ${g.devices.length - 5} 个...</div>`; html += `</div></div>`; } document.getElementById('device-list').innerHTML = html || '暂无设备'; } catch(e) { document.getElementById('device-list').innerHTML = '加载失败'; } } ``` A second sink renders semantic data in the same unsafe manner: ```javascript for (const dev of devices.slice(0, 4)) { const tags = dev.tags || []; html += `<div style="display:flex; justify-content:space-between; align-items:center; padding: 8px 0; border-bottom: 1px solid var(--border);"> <span style="font-size: 12px; flex: 1;">${dev.friendly_n ...[truncated 2073 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not generate HTML by concatenating untrusted values. - Create elements with DOM APIs and assign untrusted values through `textContent`. - If rich HTML is unavoidable, sanitize it with a well-maintained allowlist-based sanitizer. - Apply the same correction to every `innerHTML` sink, including device, insight, room, statistical, and semantic rendering. - Deploy a restrictive Content Security Policy that disallows inline scripts and event handlers. - Remove the Home Assistant token from local storage to reduce the impact of any residual XSS issue. - Add frontend tests using entity names containing HTML metacharacters and common XSS payloads. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
src/services/ha_client.py:12
Finding
Long-Lived Home Assistant Bearer Token May Be Sent Over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `src/services/ha_client.py:12-19`, `src/services/ha_client.py:59-66` **Vulnerability Type**: Plaintext transmission of bearer credentials **Risk Level**: High ### Vulnerable Code ```python class HAConfig(BaseModel): """HA 配置 - 从环境变量读取""" url: str = Field(default_factory=lambda: os.getenv("HA_URL", "")) token: str = Field(default_factory=lambda: os.getenv("HA_TOKEN", "")) def __init__(self, **data): if "url" not in data or not data["url"]: data["url"] = os.getenv("HA_URL", "http://homeassistant.local:8123") if "token" not in data or not data["token"]: data["token"] = os.getenv("HA_TOKEN", "") super().__init__(**data) ``` ```python async def _get_session(self) -> aiohttp.ClientSession: """获取或创建会话(复用连接)""" if self._session is None or self._session.closed: self._session = aiohttp.ClientSession( headers={"Authorization": f"Bearer {self.token}"}, timeout=aiohttp.ClientTimeout(total=30), connector=aiohttp.TCPConnector( limit=100, limit_per_host=30 ) ) return self._session ``` The documented configuration also recommends plaintext HTTP: ```env HA_URL=http://192.168.x.x:8123 HA_TOKEN=你的令牌 ``` ### Technical Analysis The application supports and recommends Home Assistant URLs using unencrypted HTTP while attaching a long-lived bearer token to each request. HTTP provides neither confidentiality nor server authenticity. An attacker able to observe local-network traffic can recover the Authorization header. An active network attacker can also modify Home Assistant responses or redirect traffic through spoofing techniques. Because the credential is long-lived, compromise can remain useful well after the intercepted request. ### Attack Path 1. The service is configured with an `http://` Home Assistant URL, as shown in the documentation and d ...[truncated 581 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Require HTTPS for non-loopback Home Assistant URLs. - Validate TLS certificates using the system trust store or a configured private certificate authority. - Reject `http://` URLs during configuration unless an explicit insecure-development override is enabled. - Limit any insecure override to loopback or a tightly controlled development environment. - Update documentation and Docker examples to use `https://`. - Use a dedicated Home Assistant account with the minimum privileges necessary. - Rotate any long-lived tokens that may previously have traversed an untrusted plaintext network. - Consider network segmentation and firewall rules restricting Home Assistant access to the middleware host. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (105)

Credential Access

High
Category
Privilege Escalation
Content
pip install -r requirements.txt

# 3. 配置环境变量
cp .env.example .env
# 编辑 .env,填写 HA 地址和 Token

# 4. 启动服务
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Privileged Container / Container Escape

High
Category
Privilege Escalation
Content
```bash
   docker run -d \
     --name homeassistant \
     --privileged \
     --network=host \
     -v ~/ha:/config \
     homeassistant/home-assistant:stable
Confidence
80% confidence
Finding
Potential security issue detected. Manual review is recommended.

Privileged Container / Container Escape

High
Category
Privilege Escalation
Content
docker run -d \
     --name homeassistant \
     --privileged \
     --network=host \
     -v ~/ha:/config \
     homeassistant/home-assistant:stable
   ```
Confidence
80% confidence
Finding
Potential security issue detected. Manual review is recommended.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
A system that primarily executes scenes, tasks, and HA service calls has direct actuation power over the physical environment, which is more sensitive than the abstract 'middleware' description suggests. In a smart-home context, undocumented actuation can affect locks, climate, cameras, alarms, or power devices, increasing safety and privacy risk.

Credential Access

High
Category
Privilege Escalation
Content
pip install -r requirements.txt

# 配置环境变量
cp .env.example .env
# 编辑 .env,填写 HA 地址和 Token
```
Confidence
87% confidence
Finding
The skill explicitly requires placing a long-lived Home Assistant token in a .env file, indicating access to sensitive credentials. Long-lived local tokens materially increase impact if the host, repository, logs, backups, or process environment are exposed, because the token can be reused to control the smart-home environment.

Known Vulnerable Dependency: fastapi==0.109.0 — 1 advisory(ies): CVE-2024-24762 (FastAPI is a web framework for building APIs with Python 3.8+ based on standard )

High
Category
Supply Chain
Confidence
92% confidence
Finding
The requirements file pins FastAPI to 0.109.0, and the static analysis indicates this version is affected by a published advisory. Even though this file alone does not prove the vulnerable code path is exercised, shipping a known-vulnerable web framework in a smart-home middleware service increases exposure because it likely processes network requests and may be internet- or LAN-accessible.

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Static analysis

No suspicious patterns detected.