T09 · Insecure Skill Coding Practices
Error
- Location
- setup.sh:141
- Finding
- Sensitive email content and API credentials may be transmitted to arbitrary or insecure LLM endpoints<![CDATA[ ## Vulnerability Details **File Location**: `setup.sh:141-144`, `setup.sh:183-203`, `scripts/email/checker.py:289-317`, `scripts/email/checker.py:361-404` **Vulnerability Type**: Unrestricted sensitive-data transmission over configurable network endpoints **Risk Level**: High ### Vulnerable Code ```bash read -r -p " Base URL [http://localhost:1234/v1]: " LLM_BASE_URL LLM_BASE_URL="${LLM_BASE_URL:-http://localhost:1234/v1}" read -r -p " API key [local]: " LLM_API_KEY LLM_API_KEY="${LLM_API_KEY:-local}" ``` ```python url = f"{LLM_BASE_URL}/chat/completions" payload = json.dumps({ "model": model, "messages": [{"role": "user", "content": prompt}], "max_tokens": LLM_MAX_TOKENS, "stream": False }).encode("utf-8") req = urllib.request.Request( url, data=payload, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {LLM_API_KEY}", "User-Agent": "OpenClawBot/1.0" }, method="POST" ) with urllib.request.urlopen(req, timeout=timeout) as resp: data = json.loads(resp.read().decode("utf-8")) ``` ### Technical Analysis The installer accepts an unrestricted LLM base URL, including non-loopback plaintext HTTP endpoints. The checker later sends an authorization bearer token and a prompt containing email sender information, subjects, message bodies, and potentially up to ten matching thread messages to that endpoint. There is no enforcement that remote endpoints use HTTPS, no provider allowlist, no certificate pinning, and no explicit warning describing which mailbox data will leave the system. Redirect behavior is also not constrained by the application. Using HTTP for a remote endpoint exposes both email content and the bearer credential to interception or modification. Even over HTTPS, a user or Agent can configure an untrusted server that directly receives the disclosed data. ### Attack Path 1. An attacker persuades the user or an integrated Agent to configu ...[truncated 1017 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Require HTTPS whenever the host is not a loopback address. - Reject URL user information, unexpected schemes, and unsafe redirects. - Maintain an explicit allowlist of supported providers or require prominent confirmation for custom endpoints. - Explain during setup that email bodies and thread history will be disclosed to the selected provider. - Add configurable redaction for credentials, financial information, authentication links, and other sensitive content. - Send only the minimum message content necessary for drafting. - Do not send a bearer credential to local providers that do not require authentication. - Consider provider-specific clients and outbound network restrictions. ]]>
