Back to skill

Security audit

ESPHome Encyclopedia

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for ESPHome help, but its documentation cache helper can fetch and persist off-domain or oversized content because redirects and response size are not bounded.

Install only if you are comfortable with a workspace-local ESPHome cache and notes directory. Treat cached pages as reference material, not trusted instructions, and avoid using the cache helper until redirects are revalidated after every hop, content type and size are bounded, and cached source URLs are auditable.

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/cache_doc.py:129
Finding

Redirect Validation Bypass and Unbounded Documentation Download

Content
View full analysis
str: req = urllib.request.Request(url, headers={'User-Agent': USER_AGENT}) with urllib.request.urlopen(req, timeout=20) as resp: charset = resp.headers.get_content_charset() or 'utf-8' return resp.read().decode(charset, errors='replace') ``` ### Technical Analysis The submitted URL is initially restricted by `validate_url()` to HTTPS URLs hosted on `esphome.io` or `www.esphome.io`. However, `urllib.request.urlopen()` follows HTTP redirects automatically, and `fetch_html()` does not validate the final response URL or each intermediate redirect target. A redirect from an allowed ESPHome URL can therefore bypass the intended hostname, scheme, port, direct-IP, user-information, and query-string restrictions. The function may retrieve content from a destination that would have been rejected if supplied directly. The response is also read into memory without a maximum byte limit and without validating its content type. A permitted endpoint or redirected destination could return a very large or non-HTML response, resulting in excessive memory consumption. The downloaded content is subsequently converted to text and written into the persistent local documentation cache, which can also consume disk space and introduce untrusted content into a cache intended to contain official ESPHome documentation. The request only includes the configured user-agent and does not intentionally transmit local files, credentials, environment variables, or workspace content. Therefore, the pre-scan network behavior is necessary for documentation retrieval, but redirect handling causes it to exceed the intended official-domain network boundary. ### Attack Path 1. A user or Agent invokes `cache ...[truncated 1778 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (4)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes answering questions and helping with ESPHome configs, but the skill also initializes directory structures and seeds a local knowledge repository. Hidden filesystem mutation is risky because users or orchestrators may invoke the skill expecting advice only, not persistent changes to the workspace.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented purpose emphasizes answering questions and helping with ESPHome configs, but the skill also initializes directory structures and seeds a local knowledge repository. Hidden filesystem mutation is risky because users or orchestrators may invoke the skill expecting advice only, not persistent changes to the workspace.

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 11)May include surrounding context.

md
sensor/actuator tuning, logs, diagnostics, and live dashboard or node
  maintenance. Use when the request is clearly about ESPHome or an ESPHome
  node/config: ESPHome/esphome, ESP32/ESP8266 in an ESPHome context, ESPHome
  dashboards, packages, substitutions, `secrets.yaml`, OTA flashing, compile
  errors, pin assignments, Wi-Fi provisioning, or node troubleshooting. Also
  use when ESPHome YAML sections such as `sensor:`, `binary_sensor:`,
  `switch:`, `light:`, `output:`, `display:`, `climate:`, `cover:`, `wifi:`,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to perform network fetches and local file writes (cache_doc.py, workspace cache/notes) but does not declare any explicit tool scope or permission boundaries. That creates an overbroad-capability risk: if invoked in an unexpected context, the agent could fetch remote content and mutate the workspace without clear policy constraints or user-visible gating.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.