T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:20
- Finding
- API Credentials Exposed Through Chat, Command-Line Arguments, and URL Parameters<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20`, `SKILL.md:22-23`, `SKILL.md:27`, and `SKILL.md:58-60` **Vulnerability Type**: Insecure credential handling and disclosure **Risk Level**: Medium ### Vulnerable Instructions English rendering of the relevant source instructions: ```text openclaw config set skills.entries.fapi-reddit.apiKey "your-complete-apiKey" Alternatively, say directly in the chat: "My fapi apiKey is xxx, and my auth_token is yyy" All requests must carry the apiKey in the URL parameters. ``` The credential configuration instruction is repeated later under a different configuration entry: ```text openclaw config set skills.entries.fapi-uk.apiKey "your-key" ``` ### Technical Analysis The Skill instructs users or agents to handle authentication credentials through three insecure channels: 1. **Chat disclosure**: Supplying an API key and `auth_token` in a conversation can expose them through conversation history, model context, application telemetry, debugging records, or server-side logs. 2. **Command-line disclosure**: Passing an API key as a command argument may store it in shell history. Depending on the operating system and execution environment, it may also be temporarily visible through process inspection or audit logs. 3. **URL parameter disclosure**: Requiring an API key in URL parameters creates additional exposure because complete URLs are routinely recorded by clients, proxies, gateways, monitoring systems, and web-server access logs. HTTPS protects the request in transit but does not prevent endpoints and intermediary infrastructure from logging the URL. The inconsistent configuration identifiers, `skills.entries.fapi-reddit.apiKey` and `skills.entries.fapi-uk.apiKey`, can also cause configuration failures that prompt users to enter the secret again or disclose it through an alternate channel. No hardcoded credential was found in the repository. The vulnerability is the prescribed credential-handling wo ...[truncated 1386 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the instruction that asks users to provide API keys or authentication tokens through chat. 2. Store credentials through OpenClaw's protected secret-storage facility or an environment-backed secret provider with restrictive access controls. 3. Avoid placing secrets in command-line arguments. Use a hidden interactive prompt, protected configuration input, or standard input where supported. 4. Change the API authentication scheme to use an HTTP header, such as: ```http Authorization: Bearer REDACTED ``` Do not include credentials in query strings or other URL parameters. 5. Ensure clients, proxies, gateways, and servers redact authentication headers and sensitive request fields from logs, traces, errors, and telemetry. 6. Use a single, consistent configuration entry name throughout the Skill documentation. 7. Issue narrowly scoped, revocable credentials with expiration and quota limits. 8. Document credential rotation and revocation procedures so users can respond quickly to suspected exposure. 9. If URL-based authentication cannot immediately be removed, use short-lived request-specific tokens and configure every involved logging layer to redact the relevant query parameter. ]]>
