T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:280
- Finding
- API Token Exposure Through Unsafe Troubleshooting Command## Vulnerability Details **File Location**: `SKILL.md`, line 280 **Vulnerability Type**: Credential disclosure through terminal output **Risk Level**: Medium ### Vulnerable Code ```bash echo $GUAIKEI_API_TOKEN ``` ### Technical Analysis The troubleshooting guidance instructs users or agents to print the complete `GUAIKEI_API_TOKEN` value. Although the application code does not otherwise log the token, this instruction can expose it through terminal scrollback, agent transcripts, continuous-integration logs, screen recordings, command history context, or support material. Printing a secret is unnecessary for determining whether an environment variable is configured. The disclosed token is transmitted as the authentication credential in the `TOKEN` header for requests to `www.guaikei.com`, so possession may allow another party to make authenticated API requests under the affected user's account or quota. ### Attack Path 1. A user encounters an authentication or configuration error. 2. The user or an automated agent follows the troubleshooting instruction. 3. The full API token is printed to the terminal. 4. Terminal output is captured in an agent transcript, build log, screen recording, or support bundle. 5. A party with access to that output extracts the token. 6. The exposed token is reused to submit authenticated API requests until it is revoked or expires. ### Impact Assessment Exploitation does not provide local operating-system privileges or arbitrary code execution. It may grant unauthorized access to the third-party API within the permissions, rate limits, billing scope, and lifetime assigned to the exposed token. Possible effects include quota consumption, unauthorized data requests, and actions being attributed to the legitimate token holder.
- Remediation
- ## Remediation Suggestions - Remove all instructions that print the complete token. - Check only whether the variable is present: ```bash test -n "$GUAIKEI_API_TOKEN" && echo configured || echo missing ``` - If token identification is required, display only a masked suffix or a non-reversible fingerprint. - Warn users not to include tokens in logs, screenshots, transcripts, or support requests. - Revoke and rotate any token that has already been printed in a shared or retained environment. - Add automated documentation scanning to reject examples that use `echo`, `printenv`, or equivalent commands on secret variables.
