T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:52
- Finding
- API Key Disclosed Through Terminal Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 52–57 **Vulnerability Type**: Plaintext credential exposure **Risk Level**: Medium ### Vulnerable Code ```bash # 1. Check if API key is set echo $VOICE_AI_API_KEY # 2. Test connection (list agents) node scripts/agent.js list ``` ### Technical Analysis The documented authentication verification procedure prints the complete value of `VOICE_AI_API_KEY` to standard output. This is a bearer credential, so possession of its value may be sufficient to authenticate to the Voice.ai API. Terminal output can be retained in CI/CD logs, command transcripts, support bundles, shell recordings, remote administration sessions, or screen-sharing recordings. Printing the credential is unnecessary because authentication can be checked without exposing its value. ### Attack Path 1. A user follows the documented pre-operation instructions. 2. `echo $VOICE_AI_API_KEY` writes the complete API key to the terminal. 3. The output is captured by a log collector, terminal recorder, screen-sharing session, or another person with access to the terminal output. 4. An attacker extracts the bearer token. 5. The attacker submits authenticated requests to the Voice.ai API using the exposed token. This path requires the attacker to obtain access to the terminal output or a system that records it. ### Impact Assessment A disclosed token may grant the attacker all permissions assigned to the affected Voice.ai API key. Depending on those permissions, the attacker could inspect account resources, access agent or call-related information, create or modify agents, deploy or pause agents, disable agents, and manage other API-backed resources. The precise scope is limited by the server-side permissions associated with the compromised key. This issue does not directly grant local operating-system privileges or arbitrary code execution. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions Do not print the API key during configuration checks. Test only whether the variable is present: ```bash if [ -n "${VOICE_AI_API_KEY:-}" ]; then echo "VOICE_AI_API_KEY is configured" else echo "VOICE_AI_API_KEY is missing" fi ``` Additional hardening measures: 1. Remove `echo $VOICE_AI_API_KEY` from all documentation and setup scripts. 2. Redact bearer tokens from application, proxy, and CI/CD logs. 3. Avoid enabling shell tracing with `set -x` while handling secrets. 4. Use a dedicated secret manager where available. 5. Assign the API key only the minimum required server-side permissions. 6. Rotate the API key immediately if it has already appeared in retained logs or shared terminal output. ]]>
