T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:45
- Finding
- API Credentials Exposed Through Terminal Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 45-47 **Vulnerability Type**: Plaintext credential disclosure **Risk Level**: High ### Vulnerable Code ```bash echo "ElevenLabs: $ELEVENLABS_API_KEY" && echo "OpenAI: $OPENAI_API_KEY" ``` ### Technical Analysis The documented environment check expands and prints the complete values of `ELEVENLABS_API_KEY` and `OPENAI_API_KEY`. Secret values should never be written to standard output merely to confirm whether credentials are configured. The exposed values may be retained in CI/CD logs, terminal recordings, agent transcripts, debugging output, or centralized log systems. Anyone with access to those records could recover the credentials. ### Attack Path 1. A user follows the setup instructions and runs the documented command. 2. The shell expands both environment variables into plaintext. 3. The complete API keys are printed to the terminal. 4. Terminal output is captured in a CI log, session transcript, screen recording, or shared troubleshooting report. 5. An unauthorized party obtains the recorded output and extracts the API keys. 6. The party uses the keys to submit API requests under the victim's account. ### Impact Assessment An attacker who obtains a disclosed key can access the corresponding TTS API with the privileges assigned to that credential. This can result in unauthorized API consumption, financial charges, quota exhaustion, disruption of legitimate synthesis requests, and possible access to account-scoped API resources. The exposure does not directly grant local operating-system privileges. Its scope is limited by the permissions, spending limits, and account restrictions attached to the compromised API keys. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions Do not print secret values. Test only whether each environment variable is present: ```bash if [ -n "${ELEVENLABS_API_KEY:-}" ]; then echo "ElevenLabs configured" else echo "ElevenLabs not configured" fi if [ -n "${OPENAI_API_KEY:-}" ]; then echo "OpenAI configured" else echo "OpenAI not configured" fi ``` Additional hardening measures: 1. Redact API keys from application, CI/CD, and agent logs. 2. Configure secret masking in CI/CD systems. 3. Store credentials in an approved secret manager rather than plaintext configuration files. 4. Rotate any key that may already have appeared in logs or transcripts. 5. Apply API spending limits, least-privilege scopes, and usage alerts where supported. ]]>
