T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:36- Finding
Skill Instructions Expose the Complete Credential File
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 36-42
Vulnerability Type: Unnecessary credential disclosure
Risk Level: HighVulnerable Code
markdown API keys are required to use this Skill. API keys are stored in the `~/.upkuajing/.env` file: ```bash cat ~/.upkuajing/.envExample file content:
text UPKUAJING_API_KEY=your_api_key_heretext ### Technical Analysis The Skill instructs the Agent to print the entire contents of a credential file. The implementation only needs to determine whether `UPKUAJING_API_KEY` exists and then load its value internally. Displaying the file is not necessary for the declared LinkedIn person-search functionality and exceeds least-privilege requirements. This behavior may place the API key—and any additional secrets stored in the same file—into terminal output, Agent context, conversation transcripts, debugging records, or other logs. Although the code sends the bearer token only to the fixed vendor API host, the documentation introduces a separate local disclosure channel. ### Attack Path 1. A user invokes the Skill without an API key already available in the process environment. 2. The Agent follows the documented credential-checking procedure. 3. The Agent executes `cat ~/.upkuajing/.env`. 4. The complete file contents are emitted to standard output. 5. The API key and any unrelated values in the file become accessible through the visible session, transcript, terminal capture, or logging infrastructure. 6. A party with access to that output can reuse the bearer token against the vendor API. ### Impact Assessment Successful exposure may allow unauthorized use of paid API functions and access to account information associated with the bearer token. The scope is limited to credentials and other data present in `~/.upkuajing/.env`; no evidence indicates privilege escalation to operating-system administrator access.- Remediation
View remediation
Remediation Suggestions
-
Remove the instruction to print the entire
.envfile. -
Check only whether the required variable exists and contains a nonempty value.
-
Never include the credential value in Agent-visible output.
-
Use a presence-only check such as:
bash grep -q '^UPKUAJING_API_KEY=.' ~/.upkuajing/.env -
Prefer the process environment or an operating-system credential store over a plaintext
.envfile. -
If diagnostic output is necessary, return only a result such as
API key configured: yesand never reveal a prefix or suffix of the key.
-
