T09 · Insecure Skill Coding Practices
- Location
SKILL.md:37- Finding
API Key Disclosure Through Documented Credential File Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:37-46
Vulnerability Type: Plaintext credential exposure
Risk Level: MediumVulnerable Code
markdown This skill requires an API key. The API key is stored in the `~/.upkuajing/.env` file: ```bash cat ~/.upkuajing/.envExample file content:
text UPKUAJING_API_KEY=your_api_key_hereAPI Key Not Set
First check if the
~/.upkuajing/.envfile has UPKUAJING_API_KEY;text ### Technical Analysis The documented `cat ~/.upkuajing/.env` command prints the complete contents of the credential file. Because the file contains the API key in plaintext, following this instruction exposes the secret through standard output. Checking whether the required variable exists does not require displaying its value. The instruction therefore exceeds the minimum access and disclosure needed for the Skill's declared functionality. Output may be captured in an Agent transcript, terminal log, screen recording, screenshot, or other monitoring system. No evidence was found that the Skill intentionally sends the key to an unrelated service. The vulnerability is the unnecessary disclosure caused by the documented inspection procedure. ### Attack Path 1. A user or Agent follows the documented API-key troubleshooting procedure. 2. The command prints the complete `UPKUAJING_API_KEY` value. 3. The output is retained in a conversation transcript, terminal capture, diagnostic log, screenshot, or other accessible channel. 4. An unauthorized party obtains the exposed key. 5. The party submits authenticated requests to the UpKuaJing API using the compromised credential. ### Impact Assessment An attacker who obtains the key may perform operations authorized by the associated UpKuaJing account, including paid API queries and supported account-related API actions. This can cause unauthorized charges, balance depletion, exposure of data available through the ...[truncated 250 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to print the entire credential file.
- Check only whether the required variable is present, without displaying its value.
- If status output is necessary, return only a Boolean result such as “API key configured.”
- Redact secrets from Agent responses, terminal output, diagnostic reports, and examples.
- Advise users to rotate the key immediately if it has appeared in a transcript or log.
- Prefer the process environment or a dedicated secret manager over manual credential-file inspection.
