T09 · Insecure Skill Coding Practices
- Location
SKILL.md:79- Finding
API Key Disclosure Through Credential File Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 79-82
Vulnerability Type: Credential exposure through terminal output
Risk Level: MediumVulnerable Code Snippet:
bash cat ~/.upkuajing/.envTechnical Analysis
The Skill instructs the Agent to print the complete contents of the credential file. This file contains
UPKUAJING_API_KEY, so executing the command exposes the plaintext secret through standard output.Printing the credential is not necessary to determine whether it is configured. Terminal output may be retained in Agent conversation history, command logs, telemetry, debugging records, or other captured execution output. This behavior therefore expands access to the secret beyond the minimum privilege required for authenticated API calls.
Attack Path
- The Agent loads the Skill instructions and needs to verify API-key configuration.
- The Agent follows the documented command and executes
cat ~/.upkuajing/.env. - The complete API key is emitted to terminal output.
- The output is captured in an Agent transcript, execution log, telemetry system, or shared terminal.
- A party with access to that output obtains the API key.
- The exposed key is used to make authenticated or paid requests under the victim's account.
Impact Assessment
Successful exploitation discloses the vendor API credential. An attacker could access functionality authorized by that key, consume the account balance through paid requests, retrieve available account information, or create unwanted recharge-related operations. The issue does not directly grant operating-system privileges, but it compromises the external service account associated with the key.
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to print the credential file.
- Use a non-disclosing test that reports only whether a non-empty key exists.
- Never include the key value in terminal output, Agent responses, exceptions, or logs.
- Update the Skill instructions to explicitly prohibit displaying the API key.
- If a key may already have appeared in captured output, revoke and rotate it.
- Prefer passing the key through a protected environment variable or operating-system secret store rather than inspecting a plaintext file interactively.
