T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:105
- Finding
- Credential File Contents Are Explicitly Printed## Vulnerability Details **File Location**: `SKILL.md`, lines 105-107 **Vulnerability Type**: Unnecessary credential disclosure **Risk Level**: High ### Vulnerable Code Snippet ```bash cat ~/.upkuajing/.env ``` The surrounding instructions state that this file contains the API key and direct the operator or Agent to display it. ### Technical Analysis The Skill only needs to determine whether `UPKUAJING_API_KEY` is configured and then read that specific value internally for authentication. Printing the entire credential file is not required for email sending, task retrieval, or account management. Displaying the file can expose the API key through: - Agent conversation context and execution records - Terminal output and transcripts - Screen recordings or shared terminal sessions - CI/CD logs - Remote administration logs - Diagnostic bundles containing command output The implementation already includes an internal credential loader in `scripts/common.py`, so direct display of the secret provides no necessary functional benefit and exceeds minimum safe credential access. ### Attack Path 1. A user or Agent follows the Skill instructions and executes the command. 2. The API key is written to terminal output. 3. The output is retained in an Agent transcript, shell session recording, CI log, or support bundle. 4. An attacker with access to that record extracts the Bearer token. 5. The attacker uses the token against the platform API. 6. The attacker can submit email jobs, retrieve campaign and recipient tracking records, inspect account information, or initiate payment-order creation within the permissions associated with the key. ### Impact Assessment Compromise exposes the authenticated capabilities of the affected platform account. Potential impact includes unauthorized paid email submission, access to recipient email addresses, disclosure of message subjects and content, access to delivery/open/click tracking information, and unauthorized account opera ...[truncated 6 chars]
- Remediation
- ## Remediation Suggestions - Remove the instruction to print `~/.upkuajing/.env`. - Test only whether the required variable is present, without displaying its value. - Prefer protected environment-variable injection or an operating-system secret manager. - If file-based storage remains necessary, read only the named key internally. - Redact API keys from all terminal output, exception messages, diagnostic data, and Agent transcripts. - Add documentation warning users never to paste API keys into conversations or command output. - Rotate any key that may already have been exposed through this instruction.
