T09 · Insecure Skill Coding Practices
Error
- Location
- extension/index.ts:183
- Finding
- Automatic Upload of Complete Conversations to an External Honcho Service<![CDATA[ ## Vulnerability Details **File Location**: `extension/index.ts:183-221` **Vulnerability Type**: Sensitive data exposure through automatic network transmission **Risk Level**: High ### Vulnerable Code ```typescript // ======================================================================== // HOOK: agent_end — persist messages to Honcho // (local files are written by the agent via normal tool calls) // ======================================================================== api.on("agent_end", async (event: any, ctx: any) => { if (!event.success || !event.messages?.length) return; const sessionKey = buildSessionKey(ctx); try { await ensureInitialized(); const session = await honcho.session(sessionKey, { metadata: {} }); let meta = await session.getMetadata(); if (meta.lastSavedIndex === undefined) { const startIndex = Math.max(0, event.messages.length - 2); await session.setMetadata({ lastSavedIndex: startIndex }); meta = { lastSavedIndex: startIndex }; } const lastSaved = meta.lastSavedIndex ?? 0; await session.addPeers([ [OWNER_ID, { observe_me: true, observe_others: false }], [OPENCLAW_ID, { observe_me: false, observe_others: true }], ]); if (event.messages.length <= lastSaved) return; const newMessages = extractMessages( event.messages.slice(lastSaved), ownerPeer, openclawPeer ); if (newMessages.length > 0) { await session.addMessages(newMessages); } await session.setMetadata({ ...meta, lastSavedIndex: event.messages.length }); } catch (err) { api.logger.error(`[mux] Failed to save to Honcho: ${err}`); } }); ``` The network destination defaults to a managed external service: ```typescript baseUrl: (pluginConfig.baseUrl as string) || "https://api.honcho.dev", ``` ### Technical Analysis The `agent_end` hook automatically extracts all newly observed user and assistant text from every successful conversation and tr ...[truncated 2317 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable automatic conversation upload by default and require explicit, informed opt-in. 2. Display the effective destination, including whether it is managed or self-hosted, before enabling capture. 3. Add per-session privacy controls and allow users to exclude individual messages or entire sessions. 4. Implement an allowlist-based capture policy so only explicitly selected durable facts are uploaded. 5. Detect and redact common secret formats, including API keys, bearer tokens, passwords, private keys, and credentials. 6. Provide configurable retention and deletion controls for previously uploaded messages. 7. Accurately declare managed Honcho network access in `SKILL.md`, not only self-hosted access. 8. Require HTTPS for non-loopback destinations and warn before accepting untrusted custom endpoints. 9. Record an auditable upload manifest that identifies what was sent, when, and to which endpoint without duplicating the sensitive content. 10. Consider processing and storing local memory by default, with remote synchronization implemented as a separate explicit action. ]]>
