T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:42
- Finding
- Unrestricted External Audit Logging May Disclose Sensitive Metadata<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 42–68 **Vulnerability Type**: Unrestricted telemetry transmission and insufficient data minimization **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ## Log every autonomous action For work that did **not** need approval - the reads, the drafts, the benign tool calls you did on your own - leave a record. After each autonomous action, POST a short audit note to the bridge (set `CONTRO1_BRIDGE_URL` to its address): ```bash curl -sX POST "$CONTRO1_BRIDGE_URL/agent/audit" \ -H 'content-type: application/json' \ -d '{ "action": "browser.search", "summary": "Researched flight options for the Lisbon trip", "agent_id": "main", "session_key": "whatsapp:+15550001111", "observed": { "queries": 3, "sites": ["skyscanner", "google-flights"] }, "reason": "User asked me to find cheap dates in October", "outcome": "success" }' ``` If the `contro1` CLI is installed on your host, you can use it directly instead of curl - `contro1 audit log ...` to record an action, or `contro1 requests create ...` to ask for a human approval yourself before a sensitive step and wait for the decision. See https://contro1.com/docs/cli. Either path is fine; the point is that nothing you do autonomously goes unrecorded. Guidance: - One note per meaningful action, not per keystroke. Batch trivial steps. - `summary` is what the user would want to see later in a timeline. - `observed` holds facts (what you touched); `reason` holds your intent. Keep them separate. - Set `outcome` to `failure` when the action did not work, so the trail is honest. ``` ### Technical Analysis The skill instructs the agent to transmit a record of every meaningful autonomous action to a URL derived entirely from the `CONTRO1_BRIDGE_URL` environment variable. It does not require an HTTPS endpoint, validate the destination against a trusted-origin allowlist, require endpoint authentication, or defin ...[truncated 2151 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Restrict destinations** - Require `CONTRO1_BRIDGE_URL` to use HTTPS. - Validate the normalized hostname and port against an explicit trusted-origin allowlist. - Reject loopback, link-local, private-network, and metadata-service destinations unless explicitly required and approved. - Fail closed if validation cannot be completed. 2. **Authenticate and protect transmissions** - Require bridge authentication using short-lived, narrowly scoped credentials. - Validate TLS certificates and prohibit insecure redirect chains. - Apply integrity protection and replay resistance where appropriate. - Do not place authentication secrets in audit payloads or command-line arguments. 3. **Minimize collected data** - Define a strict schema with an allowlist of permitted fields and value types. - Replace personal session identifiers with pseudonymous, rotating identifiers. - Record action categories and counts instead of raw queries, message contents, local paths, or detailed resource names. - Establish retention limits appropriate to the audit purpose. 4. **Add mandatory redaction rules** - Explicitly prohibit logging credentials, access tokens, cookies, private keys, payment information, message bodies, personal identifiers, and file contents. - Redact URLs and paths that may contain secrets. - Bound and sanitize all free-form fields such as `summary`, `observed`, and `reason`. 5. **Require informed configuration** - Obtain user or administrator approval before enabling external audit export. - Clearly identify the recipient, collected fields, retention policy, and purpose. - Prefer local protected logging when no approved bridge is configured. 6. **Harden the implementation** - Use a dedicated client that performs schema validation, redaction, authentication, and endpoint validation rather than a generic `curl` example. - Report logging failures without silently redirecting ...[truncated 49 chars]
