T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:25
- Finding
- Potential Disclosure of Full Gateway Configuration to an External Model Provider<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 25–32 and 73–77 **Vulnerability Type**: Sensitive configuration exposure **Risk Level**: Medium ### Vulnerable Code ```markdown ## Settings On first run, check `settings.json` in this skill's directory. If `subagentModel` not set, ask: > "Which model for upgrade sub-agents? (e.g., `claude-sonnet-4-6`, `deepseek-chat`). Note: external providers will receive config data." Save to `settings.json`: ```json { "subagentModel": "anthropic/claude-sonnet-4-6" } ``` ``` ```markdown ### 4. Config Schema Gap Analysis Fetch the live schema and current config: - Schema: `gateway config.schema` - Current: `gateway config.get` ``` ### Technical Analysis The skill instructs the agent to retrieve the complete live gateway configuration through `gateway config.get`. It also explicitly acknowledges that configuration data may be sent to an external provider when an externally hosted subagent model is selected. The instructions do not require the agent to: - Restrict configuration retrieval to fields needed for the comparison. - Remove credentials, API tokens, webhook secrets, internal endpoints, or user identifiers. - Inspect and disclose the exact outbound data before transmission. - Obtain explicit, informed approval for each external disclosure. - Prefer local processing for sensitive configuration analysis. A gateway configuration can contain operationally sensitive values even when it is not intended to function as a secret store. Transmitting the complete object violates data-minimization and least-disclosure principles. The vulnerability is conditional on an external model being used and the retrieved configuration being included in that model's context. ### Attack Path 1. The skill is invoked to upgrade or audit OpenClaw. 2. The configured `subagentModel` points to an externally hosted model provider. 3. The skill retrieves the complete gateway configuration with `gateway config.get`. 4 ...[truncated 1213 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Perform schema comparison locally without placing the complete configuration in a model context. 2. Retrieve only fields required to identify enabled channels, plugins, and explicitly configured schema paths. 3. Introduce a mandatory recursive redaction layer for: - Passwords and passphrases. - API keys and bearer tokens. - Webhook and signing secrets. - Private keys and certificates. - Session cookies and authentication headers. - Sensitive values referenced through secret-management systems. 4. Replace secret values with type-preserving placeholders such as `[REDACTED_TOKEN]`. 5. Show the user a preview of all fields that would be transmitted externally and obtain explicit approval before transmission. 6. Default to a local model or local deterministic comparison routine when configuration data is involved. 7. Document the selected provider, data-retention implications, and the minimum configuration fields required for the operation. 8. Add a validation step that aborts external processing if potentially secret-bearing fields remain after redaction. ]]>
