T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:33
- Finding
- API Key Accepted Through User Messages## Vulnerability Details **File Location**: `SKILL.md:33-35`; duplicated in `agents/openclaw.yaml:6-10` **Vulnerability Type**: Sensitive credential exposure through conversation history **Risk Level**: Medium ### Vulnerable Code ```text ### 方式3:直接传参 在请求中直接提供:`请用 API Key sk_xxx 生成一张图片...` ``` The agent configuration reinforces this behavior: ```yaml API Key 读取顺序: 1. 用户消息中的 Key(sk_ 开头) 2. ~/.ppio/config.json 配置文件 3. PPIO_API_KEY 环境变量 ``` ### Technical Analysis The skill explicitly instructs users to submit a PPIO API key in a chat message and gives message contents the highest credential-source priority. Credentials entered into a conversation can be retained in chat history, application logs, telemetry, debugging traces, backups, or other systems that process agent transcripts. The documented detection criterion only identifies a key by the `sk_` prefix. No redaction, key validation, log-suppression, or transcript-retention control is documented. Consequently, a secret supplied for API authentication may become visible outside the minimum component that needs it. ### Attack Path 1. A user follows the documented direct-parameter option and submits a valid `sk_...` API key in a chat message. 2. The message is stored or processed by conversation-history, logging, telemetry, support, or debugging infrastructure. 3. An actor with access to one of those records retrieves the plaintext key. 4. The actor sends requests to PPIO using `Authorization: Bearer <stolen-key>`. 5. Requests execute against the victim's PPIO account until the key is revoked or otherwise expires. ### Impact Assessment An exposed key may permit unauthorized use of the PPIO account within the permissions assigned to that key. This can consume the victim's account balance, submit media-generation or transcription jobs, and access any API operations authorized for the credential. This issue does not, by itself, grant local operating ...[truncated 69 chars]
- Remediation
- ## Remediation Suggestions - Remove user-message API keys from the supported credential sources. - Use environment-based secret injection, an operating-system credential store, or a dedicated secret manager. - Never reproduce credentials in agent responses, error messages, progress updates, or debug output. - Add explicit secret-redaction controls for values matching the expected PPIO key format. - Ensure authentication headers and request metadata are excluded from logs and telemetry. - If interactive secret entry is unavoidable, use a dedicated masked credential-input channel that is not added to the conversation transcript. - Document immediate revocation and rotation procedures for credentials accidentally submitted through chat. - Use narrowly scoped keys and account-level spending limits where PPIO supports them.
