T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:31
- Finding
- Unredacted Error Messages Are Transmitted to an External Telemetry Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 31–53 **Vulnerability Type**: Sensitive-data exposure through unrestricted telemetry **Risk Level**: High ### Vulnerable Code ```markdown curl -s -X POST https://agentpulse.dev/api/events \ -H "Content-Type: application/json" \ -H "x-api-key: $AGENTPULSE_API_KEY" \ -d '{ "agent_name": "AGENT_NAME_HERE", "framework": "openclaw", "events": [ { "timestamp": "ISO_8601_TIMESTAMP", "provider": "PROVIDER", "model": "MODEL_NAME", "input_tokens": INPUT_TOKEN_COUNT, "output_tokens": OUTPUT_TOKEN_COUNT, "latency_ms": LATENCY_IN_MS, "status": "success_or_error", "error_message": null } ] }' Replace the placeholders with actual values from the API call: - AGENT_NAME_HERE: The name of the current agent - PROVIDER: "anthropic", "openai", "minimax", "deepseek", "google", "mistral", etc. - MODEL_NAME: The exact model string (e.g., "claude-sonnet-4-5", "gpt-4o", "MiniMax-M2.5") - INPUT_TOKEN_COUNT / OUTPUT_TOKEN_COUNT: Token counts from the API response - LATENCY_IN_MS: How long the call took in milliseconds - status: "success" or "error" - error_message: null if success, or the error message string if failed ``` ### Technical Analysis The Skill directs the agent to copy the complete error message from a failed API call into an event submitted to `https://agentpulse.dev/api/events`. It defines no allowlist, redaction procedure, maximum length, or validation step for that field. Error messages are not reliably limited to harmless diagnostic codes. Depending on the failed provider or integration, they may contain request fragments, prompt excerpts, user-supplied content, account or resource identifiers, local paths, request URLs, or credentials. Consequently, forwarding the raw value can expose data beyond the declared operational metadata. This behavior also conflicts with the security statement that no p ...[truncated 1582 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not transmit raw error messages by default. Report only a normalized error category, HTTP status, provider error code, and retryability flag. 2. Implement strict allowlist-based extraction rather than attempting to blacklist known secret formats. 3. Remove prompt text, request bodies, URLs with query strings, authorization headers, tokens, email addresses, file paths, and provider-specific diagnostic details. 4. Truncate all diagnostic fields to a small documented maximum length after sanitization. 5. Require explicit informed consent before enabling any diagnostic payload beyond aggregate metadata. 6. Present the exact transmitted fields and retention policy during setup. 7. Provide a local preview or audit log so users can inspect telemetry before it leaves the system. 8. Update the security statement to accurately disclose any remaining possibility that diagnostics may contain user or personal data. 9. Add tests containing representative API keys, bearer tokens, prompt excerpts, URLs, and personal identifiers to verify that telemetry sanitization removes them. ]]>
