T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:70
- Finding
- Credential File Contents May Be Exposed Through Documented Inspection Command## Vulnerability Details **File Location**: `SKILL.md`, lines 70–75 **Vulnerability Type**: Plaintext credential disclosure **Risk Level**: Medium **Vulnerable Code Snippet**: ```bash cat ~/.upkuajing/.env ``` ```text UPKUAJING_API_KEY=your_api_key_here ``` ### Technical Analysis The documented command prints the entire contents of `~/.upkuajing/.env`, although the Skill only needs to determine whether `UPKUAJING_API_KEY` exists. A shared environment file may contain additional credentials or sensitive configuration unrelated to this Skill. Output from the command may become visible in terminal history, execution logs, captured Agent tool output, or conversation context. This exceeds the minimum privilege required to authenticate API requests because checking for one variable does not require revealing any variable value. The reviewed implementation does not automatically transmit the contents of this file to another destination. The vulnerability is an unnecessary local disclosure caused by following the Skill instructions. ### Attack Path 1. A user or another application stores `UPKUAJING_API_KEY` and possibly other secrets in `~/.upkuajing/.env`. 2. An Agent or user follows the documented environment-check procedure. 3. The `cat` command prints every key and value in the file. 4. The output is retained in terminal logs, Agent execution records, or conversation context. 5. Anyone with access to those records may recover the exposed credentials. ### Impact Assessment An attacker who can access the captured output may obtain the UpKuaJing API key and any unrelated secrets stored in the same file. A stolen API key could permit authenticated, paid API requests within the privileges and balance associated with the account. This issue does not directly grant operating-system privilege escalation.
- Remediation
- ## Remediation Suggestions - Remove the instruction to print the complete `.env` file. - Check only whether `UPKUAJING_API_KEY` is present and non-empty. - Never display the full key; if diagnostic output is necessary, show only a short redacted fingerprint. - Prefer the process environment over a plaintext credential file. - Ensure Agent tool output and command logs never contain credential values. - Update error messages so they identify the configuration location without instructing users to reveal its contents.
