T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Plaintext API Key Persisted in the Skill Definition
- Content
View full analysis
` - **Required**; otherwise divination requests return a 401 authentication error. - If it is not configured: guide the user to obtain a key. If this agent has permission, write it into this file; otherwise, instruct the user to edit this file manually. Finally, replace the `` placeholder. ``` The excerpt above is an English rendering of the identified source lines. ### Technical Analysis The Skill explicitly instructs the agent to replace the placeholder in `SKILL.md` with the user's real API key. This persists a live credential in plaintext inside the Skill package rather than using the declared `API_KEY` environment variable or a dedicated secret store. A Markdown file in a project directory may be committed to source control, included in archives, copied into backups, indexed by development tools, exposed in diagnostic output, or redistributed with the Skill. Persisting the key in this location therefore expands credential access beyond the process that needs it and exceeds the minimum privileges required to authenticate an API request. No credential was embedded in the audited copy; the vulnerability is the documented workflow that causes a future user or agent to persist one insecurely. ### Attack Path 1. A user invokes the Skill while the API key placeholder is still present. 2. The Skill directs the user to obtain an API key. 3. An agent with file-write access replaces the placeholder in `SKILL.md` with the live credential. 4. The project is subsequently committed, archived, logged, backed up, shared, or inspected by another user or process. 5. An unauthorized party extracts the plaintext key. 6. The party submits authenticated requests to the external API using the exposed credential. ### Impact Assessment An ...[truncated 525 chars]- Remediation
View remediation
