T09 · Insecure Skill Coding Practices
- Location
SKILL.md:38- Finding
Credential File Contents Are Instructed to Be Printed to the Terminal
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 38-44
Vulnerability Type: Plaintext credential exposure
Risk Level: Mediumbash cat ~/.upkuajing/.envtext UPKUAJING_API_KEY=your_api_key_hereTechnical Analysis
The instructions recommend printing the complete contents of the credential file to standard output. Although accessing the API key is necessary for authenticated API requests, displaying the entire file is not required for the declared school-detail lookup functionality.
Terminal output may be retained in agent transcripts, command logs, CI output, terminal scrollback, screenshots, or monitoring systems. The command also exposes every other value stored in the file, not only the required API key.
The implementation in
scripts/common.pycan load the key directly, so displaying it provides no functional security benefit.Attack Path
- A user or agent follows the documented credential-check procedure.
- The complete
~/.upkuajing/.envfile is printed to standard output. - The output is captured in an agent transcript, terminal log, CI log, or shared screen.
- A party with access to that output obtains the API key or other secrets present in the file.
- The exposed key is used to issue authenticated API requests, inspect account information, create recharge orders, or consume the associated account balance.
Impact Assessment
An attacker could act with the API privileges granted to the exposed key. The practical scope includes paid API consumption and access to account-related information exposed by the service. This does not provide operating-system privilege escalation, but it can compromise the associated Upkuajing API account and any additional secrets stored in the same file.
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to run
cat ~/.upkuajing/.env. - Check only whether the variable exists without revealing its value, for example by using the existing
get_api_key()function or a command that emits only a present-or-missing status. - Never ask users to paste API keys into conversational output.
- Recommend using the process environment or a dedicated secret manager where available.
- Warn users not to place unrelated credentials in the same file.
- Redact API keys from transcripts, diagnostics, and error messages.
- Rotate any key that has already appeared in terminal or agent logs.
- Remove the instruction to run
