T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:66- Finding
Credential Disclosure Through Documented Secret-File Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:66-75
Vulnerability Type: Unnecessary exposure of an API credential
Risk Level: Highmarkdown 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 Skill explicitly instructs the agent to execute `cat ~/.upkuajing/.env`. This prints the complete plaintext contents of a credential file into command output. In an agent environment, command output may be copied into model context, conversation transcripts, execution logs, monitoring systems, or debugging records. The declared functionality only requires determining whether `UPKUAJING_API_KEY` exists and allowing the scripts to use it for authenticated requests. Neither task requires revealing the key. Reading and displaying the entire file therefore exceeds the minimum privilege necessary for the Skill. The command also exposes every other variable that may be present in the file, not only the UpKuaJing key. ### Attack Path 1. A user invokes the Skill without explicitly supplying an API key. 2. The agent follows the documented setup procedure. 3. The agent executes `cat ~/.upkuajing/.env`. 4. The complete API key and any other file contents enter the tool output and agent transcript. 5. A party with access to transcripts, logs, shared session output, or monitoring data obtains the credential. 6. The exposed key can be reused against authenticated UpKuaJing endpoints until it is revoked. ### Impact Assessment Exposure grants the attacker the same API privileges as the affected key. This may include access to account information, company and personal-data searches, contact-information retrieval, payment-order creation, and consumption ...[truncated 198 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to run
cat ~/.upkuajing/.env. - Prefer injecting
UPKUAJING_API_KEYdirectly through the execution environment. - If presence must be checked, use a helper that emits only a boolean result and never the value.
- Restrict any file check to the exact expected variable rather than reading or displaying the entire file.
- Add explicit guidance that API keys must never be printed in tool output, logs, errors, or conversational responses.
- Revoke and rotate any key that has already appeared in execution transcripts.
- Remove the instruction to run
