T09 · Insecure Skill Coding Practices
- Location
SKILL.md:183- Finding
Troubleshooting Instructions Expose API Credentials in Terminal and Agent Logs
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 183–191
Vulnerability Type: Credential disclosure through unsafe troubleshooting instructions
Risk Level: MediumVulnerable Code Snippet
bash ### 1. Check API Key ```bash # Method 1: Check the Skill directory .env cat /path/to/skills/bizyair-banana2/.env # Method 2: Check user configuration cat ~/.config/bizyair-banana2/.env cat ~/.bizyair-banana2/.envtext ### Technical Analysis The referenced `.env` files are documented as containing the user's `BIZYAIR_API_KEY`. The troubleshooting commands print their complete contents directly to standard output. Although reading a dedicated Skill configuration file internally is necessary for authentication, displaying the full file is not required for diagnosis and violates the principle of minimizing secret exposure. When these commands are executed through an AI agent or interactive terminal, the credential may be retained in tool transcripts, terminal history captures, support logs, screen recordings, or session telemetry. The executable script itself restricts credential lookup to the environment and Skill-specific configuration paths and transmits the key only to the BizyAir API. The vulnerability is therefore in the documented troubleshooting procedure rather than evidence of intentional credential exfiltration. ### Attack Path 1. A user encounters an authentication or configuration problem. 2. The user or an AI agent follows the troubleshooting procedure in `SKILL.md`. 3. One or more `cat` commands print the complete `.env` file, including `BIZYAIR_API_KEY`. 4. The command output is captured in an agent transcript, terminal log, support record, screen share, or other observable channel. 5. An unauthorized party with access to that output extracts the bearer credential. 6. The party reuses the key against BizyAir services within the permissions and account limits associated with ...[truncated 503 chars]- Remediation
View remediation
Remediation Suggestions
-
Remove all instructions that print
.envfiles or credential values. -
Replace them with checks that confirm file existence and key presence without displaying the secret, for example:
bash config="$HOME/.config/bizyair-banana2/.env" if [ -f "$config" ]; then echo "Configuration file exists" else echo "Configuration file is missing" fi if grep -q '^BIZYAIR_API_KEY=.' "$config" 2>/dev/null; then echo "BIZYAIR_API_KEY is configured" else echo "BIZYAIR_API_KEY is missing or empty" fi -
Recommend restrictive permissions for credential files:
bash chmod 600 ~/.config/bizyair-banana2/.env chmod 600 ~/.bizyair-banana2/.env -
Instruct users to rotate the API key immediately if it has already appeared in an agent transcript, terminal capture, support log, or screen recording.
-
Prefer environment-based secret injection or a dedicated secret manager where supported, and ensure application errors never include credential values.
-
Update every troubleshooting guide consistently so unsafe commands are not reintroduced from copied documentation.
-
