T09 · Insecure Skill Coding Practices
- Location
SKILL.md:33- Finding
API Key Accepted Through User Messages
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:33-35; duplicated inagents/openclaw.yaml:6-10
Vulnerability Type: Sensitive credential exposure through conversation history
Risk Level: MediumVulnerable 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
- A user follows the documented direct-parameter option and submits a valid
sk_...API key in a chat message. - The message is stored or processed by conversation-history, logging, telemetry, support, or debugging infrastructure.
- An actor with access to one of those records retrieves the plaintext key.
- The actor sends requests to PPIO using
Authorization: Bearer <stolen-key>. - 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]
- A user follows the documented direct-parameter option and submits a valid
- Remediation
View 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.
