Back to skill

Security audit

Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims: it sends an image prompt to Zhipu AI using a user-provided API key, with no hidden persistence or unrelated behavior found.

Install only if you are comfortable sending prompts to Zhipu AI and using a ZHIPU_API_KEY in your local environment. Avoid prompts containing secrets, personal data, regulated data, or confidential business content, and run it on a trusted machine because the API key may be visible to local process inspection while curl is running.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate.sh:37
Finding
API Key Exposed Through curl Process Arguments## Vulnerability Details **File Location**: `scripts/generate.sh`, lines 37-40 **Vulnerability Type**: Sensitive credential exposure through command-line arguments **Risk Level**: Medium ```bash # Call Zhipu API RESULT=$(curl -s --proto =https --tlsv1.2 -m 60 -X POST "https://open.bigmodel.cn/api/paas/v4/images/generations" \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ ``` ### Technical Analysis The shell expands `$KEY` before launching `curl`, placing the complete bearer token inside the `Authorization` header passed as a command-line argument. While the request is active, the expanded header may be visible through process inspection interfaces or captured by process-monitoring and auditing software. Exploitation requires local process-inspection access, and operating-system restrictions may limit which users can inspect another user's processes. Nevertheless, command-line arguments are not an appropriate channel for secrets because they can be retained or exposed outside the intended process. `SKILL.md` acknowledges this process-list visibility, but documentation does not mitigate the underlying credential exposure. ### Attack Path 1. A victim exports a valid `ZHIPU_API_KEY` and runs `scripts/generate.sh`. 2. The script expands `$KEY` into the `curl` command-line argument containing the Authorization header. 3. During the API request, a local user or monitoring service with sufficient process-inspection access reads or records the curl argument list. 4. The observer extracts the bearer token from the captured header. 5. The stolen key is reused to authenticate directly to the Zhipu API. ### Impact Assessment An attacker who obtains the key gains the API privileges associated with the victim's Zhipu credential. This can permit unauthorized API requests, consumption of account quota, generation of chargeable usage, and access to any other API operations authorized for that same key. ...[truncated 149 chars]
Remediation
## Remediation Suggestions - Do not pass the Authorization header containing the API key directly in curl's command-line arguments. - Provide sensitive curl configuration through standard input or another protected, non-argument channel supported by the deployed curl version. - Prevent curl from inheriting `ZHIPU_API_KEY` after the header has been prepared when operationally feasible. - Avoid storing the key in a temporary file. If a temporary credential-bearing file is unavoidable, create it with permissions restricted to the owner (`0600`), reject unsafe pre-existing paths, and guarantee deletion with a shell `trap` on normal exit and interruption. - Use a narrowly scoped API key, configure usage limits where supported, and rotate the currently deployed key if process arguments may already have been logged. - Verify the remediation by inspecting the curl process arguments during a test request and confirming that neither the raw key nor the Authorization header is present.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding
The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The usage example sends user-provided prompts to Zhipu's external image-generation API, but the documentation does not clearly and explicitly warn that prompt content is transmitted to a third-party service. This can lead users to unknowingly submit sensitive, proprietary, or personal data in prompts, creating a privacy and data-governance risk.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
export ZHIPU_API_KEY="your_key"

curl -s -X POST "https://open.bigmodel.cn/api/paas/v4/images/generations" \
  -H "Authorization: Bearer $ZHIPU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "cogview-4", "prompt": "your description"}'
Confidence
91% confidence
Finding
This command performs an outbound HTTPS request to a third-party API and includes both the user's prompt and a bearer token for authentication. While external transmission is expected for this skill's purpose, it still represents a real security concern because sensitive prompt content may leave the local environment and the API key is exposed to the invoked process and potentially local process inspection.

External Transmission

Medium
Category
Data Exfiltration
Content
}')

# Call Zhipu API
RESULT=$(curl -s --proto =https --tlsv1.2 -m 60 -X POST "https://open.bigmodel.cn/api/paas/v4/images/generations" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d "$PAYLOAD")
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.