T09 · Insecure Skill Coding Practices
- Location
SKILL.md:37- Finding
Credential disclosure encouraged through direct display of the secret file
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 37-49
Vulnerability Type: Plaintext credential exposure
Risk Level: MediumThe Skill instructs the agent to inspect the API credential by printing the entire credential file:
bash cat ~/.upkuajing/.envTechnical Analysis
Reading the API key is necessary for authenticated API calls, but displaying the complete credential file is not. The executable code already supports retrieving only
UPKUAJING_API_KEYinternally, so printing the file exceeds the minimum access and disclosure required for the declared trade-data functionality.The command exposes the secret through standard output. In an agent environment, that output may enter model context, conversation transcripts, execution logs, observability systems, screenshots, or other retained records. The file could also contain unrelated variables in addition to the expected API key.
Attack Path
- A user or agent encounters an authentication problem.
- Following the Skill instructions, the agent runs
cat ~/.upkuajing/.env. - The API key and any other values in the file are returned to the agent session.
- The output is retained in conversation or tool logs, or becomes visible to another party with access to those records.
- An exposed key is used against authenticated account, query, reporting, or payment-related API endpoints.
Impact Assessment
Exposure compromises the confidentiality of
UPKUAJING_API_KEY. Depending on server-side authorization, an attacker may consume paid API services, inspect account information, create recharge orders, submit reports, or exhaust the account balance. If unrelated secrets are stored in the same file, the disclosure scope may be broader.- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to print the entire
.envfile. - Test only whether the variable exists, without displaying its value.
- Prefer the declared process environment variable over a plaintext file.
- If file-based diagnostics are required, display only a redacted value such as the first four characters and never place the complete key in model context.
- Explicitly warn users not to paste credentials into chat.
- Recommend immediate key revocation and rotation if a credential has already appeared in logs or conversation history.
- Remove the instruction to print the entire
