T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Skill instructions encourage disclosure of the complete API key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 39-45
Vulnerability Type: Credential disclosure through unsafe operational instructions
Risk Level: HighVulnerable Code
bash cat ~/.upkuajing/.envThe documented file format confirms that this command outputs the API credential:
text UPKUAJING_API_KEY=your_api_key_hereTechnical Analysis
The Skill explicitly instructs the agent or operator to display the entire credential file. In an agent environment, command output may be copied into the conversation, tool transcript, telemetry, debug logs, or execution history.
Reading the fixed application-specific credential file is necessary only when the environment variable is unavailable. Displaying its complete contents is not necessary to establish whether the key exists. This behavior therefore exceeds the minimum access and disclosure needed for the declared alumni-query functionality.
The file may also contain additional configuration values beyond the API key. The command displays all of them without filtering or redaction.
Attack Path
- A user asks the agent to configure or troubleshoot authentication.
- The agent follows the Skill instructions and executes
cat ~/.upkuajing/.env. - The shell returns the complete API key in tool output.
- The credential is retained in the conversation transcript, logs, monitoring systems, or other systems that can access tool results.
- A party with access to those records extracts the Bearer token.
- The party uses the token against
https://openapi.upkuajing.comto invoke authenticated APIs.
Impact Assessment
Exposure grants the attacker the same API authorization represented by the key. Based on the audited scripts, this can include paid alumni searches, retrieval of account information, pricing requests, creation of recharge-payment URLs, and authenticated error reports.
Unauthorized paid calls can consume ...[truncated 224 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to print the credential file.
- Check only for presence without displaying the value, for example by using a small trusted script that returns a Boolean status.
- Prefer
UPKUAJING_API_KEYsupplied through the execution environment or a platform-managed secret store. - If diagnostics must mention a key, reveal no portion of it or use a short irreversible fingerprint.
- Add an explicit instruction that credentials must never be included in prompts, tool output, error reports, or logs.
- Treat previously displayed keys as compromised: revoke them, issue replacements, and remove them from retained transcripts and logs where possible.
