T09 · Insecure Skill Coding Practices
- Location
SKILL.md:37- Finding
Credential Disclosure Through Documented Shell Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 37-43
Vulnerability Type: Exposure of plaintext credentials in terminal and agent output
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_heretext The original documentation at this location instructs the operator to execute `cat ~/.upkuajing/.env`. ### Technical Analysis The documented `cat` command prints the entire credential file to standard output. Checking whether an API key is configured does not require displaying its value. When an AI agent follows this instruction, the plaintext key may enter the agent transcript, terminal history or recording, CI logs, support diagnostics, or other retained output. The application legitimately needs access to `UPKUAJING_API_KEY` to authenticate to the declared API. However, displaying the secret exceeds the minimum access necessary for that functionality. This is a credential-handling weakness rather than evidence that the code intentionally sends the key to an unrelated destination. ### Attack Path 1. A user or agent follows the environment setup instructions. 2. The documented `cat ~/.upkuajing/.env` command is executed. 3. The complete API key appears in terminal or agent-visible output. 4. The output is retained in a transcript, log, recording, or copied diagnostic report. 5. A party with access to that retained output extracts the API key. 6. The exposed key is used to make authenticated and potentially billable requests to the Upkuajing API. ### Impact Assessment Exploitation can disclose the privileges associated with the API token. An attacker possessing the token may be able to perform authenticated queries, consume the account balance, access account-related API data, or invoke other endpoint ...[truncated 190 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to run
cat ~/.upkuajing/.env. - Check only whether the variable exists and is nonempty, without printing its value.
- Provide a dedicated status command that returns only a boolean or a redacted fingerprint.
- Never instruct users to paste an API key into an agent conversation.
- Redact secrets from terminal output, diagnostics, logs, and error messages.
- Prefer injecting the credential through the declared
UPKUAJING_API_KEYenvironment variable or a platform-managed secret store. - Add documentation warning that the
.envfile and its contents must not be included in transcripts or support reports.
- Remove the instruction to run
