T09 · Insecure Skill Coding Practices
- Location
SKILL.md:36- Finding
Credential Disclosure Through Documented Terminal Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 36–45
Vulnerability Type: API credential exposure
Risk Level: Mediumbash cat ~/.upkuajing/.envTechnical Analysis
The Skill documentation instructs the Agent to display the complete contents of the credential file. This file contains
UPKUAJING_API_KEY, which authorizes access to paid API operations.Reading this dedicated credential for authentication is necessary for the declared functionality, but printing it is not. Running the documented command can expose the key to terminal capture, Agent context, conversation transcripts, execution logs, screen recordings, or anyone able to observe the session.
The implementation in
scripts/common.pycan already determine whether the key exists without exposing it, so this command exceeds the minimum access necessary for credential validation.Attack Path
- A user or Agent follows the documented API-key verification procedure.
- The Agent runs
cat ~/.upkuajing/.env. - The complete API key appears in terminal output.
- The output is retained in a transcript, log, monitoring system, or model context.
- An unauthorized party with access to that output extracts the key.
- The party submits authenticated, potentially billable requests against the Upkuajing API.
Impact Assessment
An attacker who obtains the key gains the API privileges associated with the affected account. This may permit access to account information and customs-data endpoints, creation of billable API requests, depletion of account balance, and submission of reports under the victim's identity.
The issue does not directly provide operating-system privilege escalation; its scope is the API account represented by the disclosed credential.
- Remediation
View remediation
Remediation Suggestions
- Remove the command that prints the credential file.
- Replace it with a non-disclosing existence check that reports only whether a nonempty
UPKUAJING_API_KEYentry is present. - Explicitly instruct the Agent never to print, echo, log, or include the API key in conversation output.
- Prefer supplying the key through the declared environment variable rather than reading a plaintext file.
- If file-based storage remains supported, document owner-only permissions and provide a safe command for correcting them.
- Redact any credential-like values from diagnostics and execution transcripts.
