T09 · Insecure Skill Coding Practices
- Location
SKILL.md:40- Finding
Credential File Contents Are Exposed Through Documented Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 40–42
Vulnerability Type: Unnecessary disclosure of plaintext credentials
Risk Level: MediumVulnerable Code
markdown This skill requires an API key. The API key is stored in the `~/.upkuajing/.env` file: ```bash cat ~/.upkuajing/.envTechnical Analysis
The Skill instructs the Agent to print the complete contents of the credential file. Reading the dedicated API key is necessary for authenticated requests, but displaying the entire file is not necessary to verify whether a key exists.
Executing this command places the plaintext API key—and potentially any other values stored in the same file—into terminal output. That output may subsequently appear in Agent context, execution logs, terminal recordings, debugging traces, or generated responses.
This exceeds the minimum privilege and disclosure required for the declared LinkedIn employment-history lookup functionality.
Attack Path
- The Agent follows the environment setup instructions.
- It executes
cat ~/.upkuajing/.env. - The plaintext API key is written to observable command output.
- The output is retained in Agent context, logs, recordings, or another monitoring system.
- A party with access to that output extracts the key.
- The exposed Bearer credential is reused to make authenticated and potentially chargeable API calls.
Impact Assessment
Successful exploitation exposes the UpKuaJing API key. An attacker possessing the key may be able to:
- Make authenticated API requests under the victim's account.
- Consume the victim's paid API balance.
- Access account information exposed by the authenticated account endpoint.
- Submit requests or reports attributable to the victim's credential.
This does not directly grant operating-system privileges, but it compromises the authority and paid resources associated with the API account.
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to run
cat ~/.upkuajing/.env. - Check only whether
UPKUAJING_API_KEYis present and nonempty without displaying its value. - Prefer environment-based secret injection over reading a persistent plaintext file.
- If diagnostic output is required, display only a non-sensitive status such as
API key configured. - If key identification is necessary, show only a short masked fingerprint and never enough characters to reconstruct the credential.
- Ensure Agent responses and logs never include the raw API key.
- Remove the instruction to run
