T09 · Insecure Skill Coding Practices
- Location
SKILL.md:37- Finding
API Key Disclosed Through Documented Terminal Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 37-43
Vulnerability Type: Plaintext credential disclosure
Risk Level: MediumVulnerable Code
bash cat ~/.upkuajing/.envtext UPKUAJING_API_KEY=your_api_key_hereTechnical Analysis
The Skill instructs the user or Agent to print the complete contents of the credential file. Although reading the API key is necessary for authenticated requests, displaying the file is not required for the declared import-statistics functionality.
Command output can be retained in Agent transcripts, terminal scrollback, execution logs, screenshots, or monitoring systems. The command also prints every other value that may be stored in the same
.envfile, rather than checking only whether the required variable exists.The runtime implementation in
scripts/common.pyalready supports reading the relevant key without printing it, so this documented disclosure exceeds minimum necessary privilege and data exposure.Attack Path
- A user requests help configuring or troubleshooting the Skill.
- The Agent follows the documented setup instructions and runs
cat ~/.upkuajing/.env. - The complete plaintext API key appears in command output.
- The output is retained in a transcript, log, screenshot, or other observable channel.
- A party with access to that output reuses the key against the Upkuajing API.
Impact Assessment
Disclosure grants the attacker the same API authorization represented by the key. The attacker may consume paid API services, inspect associated account information through supported endpoints, or create charges until the key is revoked or its balance is exhausted.
This issue does not grant operating-system privilege escalation by itself. Its scope is the API account and capabilities assigned to the exposed credential.
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to run
cat ~/.upkuajing/.env. - Check only whether the required variable exists, without displaying its value.
- Prefer passing the key through the process environment or a platform-managed secret store.
- If diagnostic identification is necessary, display a short cryptographic fingerprint rather than characters from the key.
- Explicitly warn users not to paste API keys into chat, Agent output, tickets, or logs.
- Rotate any key that may already have appeared in retained terminal or Agent output.
- Remove the instruction to run
