Back to skill

Security audit

Zhipu Embeddings

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it needs Review because it broadly advertises web/current-information lookup while sending user text and a Zhipu API key to external APIs with mismatched behavior and weak credential handling.

Install only if you intentionally want to send selected text to Zhipu. Do not use it with secrets, personal data, regulated data, or confidential internal content. Use a minimally scoped API key, avoid shared or heavily monitored systems, and do not rely on this package for general web search or latest-news retrieval unless the implementation is corrected.

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
skill/scripts/search.sh:31
Finding
Zhipu API Key Exposed in Process Command-Line Arguments## Vulnerability Details **File Location**: `skill/scripts/search.sh:31-34`; insecure usage examples also appear in `SKILL.md:41-47` and `skill/SKILL.md:41-47` **Vulnerability Type**: Credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code `skill/scripts/search.sh:31-34`: ```bash RESULT=$(curl -s --proto =https --tlsv1.2 -m 30 -X POST "https://open.bigmodel.cn/api/paas/v4/embeddings" \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -d "$PAYLOAD") ``` `SKILL.md:41-47` and `skill/SKILL.md:41-47`: ```bash curl -s -X POST "https://open.bigmodel.cn/api/paas/v4/chat/completions" \ -H "Authorization: Bearer $ZHIPU_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-4-flash", "messages": [{"role": "user", "content": "搜索: YOUR_QUERY"}], "tools": [{"type": "web_embeddings", "web_embeddings": {"embeddings_query": "YOUR_QUERY"}}] }' | jq -r '.choices[0].message.content' ``` ### Technical Analysis The API key is expanded directly into the `curl` authorization-header argument. Consequently, the complete bearer token becomes part of the process command line for the lifetime of the request. Depending on operating-system process visibility controls, other local users, privileged monitoring agents, process supervisors, diagnostic tooling, or command-line logging systems may be able to observe and retain the token. Both skill instruction files explicitly note that the key may be visible through process inspection, confirming that this exposure is an expected consequence of the implementation rather than a theoretical code path. The use of HTTPS protects the credential in transit but does not prevent local command-line disclosure. ### Attack Path 1. A victim configures `ZHIPU_API_KEY` and invokes `skill/scripts/search.sh`. 2. The script expands the key into the argument `Authorization: Bearer <key>`. 3. Whi ...[truncated 996 chars]
Remediation
## Remediation Suggestions - Do not interpolate bearer tokens into command-line arguments. - Provide the authorization header through a protected temporary curl configuration or header file with permissions set to `0600`, and remove it immediately after use with a reliable cleanup trap. - Prefer a supported credential mechanism that keeps secret values out of process arguments, environment dumps, logs, and shell history. - Run the skill under a dedicated account and restrict process inspection between users where the operating system supports it. - Disable command-line capture or apply credential redaction in process supervisors, observability agents, and diagnostic tooling. - Use a narrowly scoped Zhipu key with minimal permissions, usage limits, and regular rotation. - Update both `SKILL.md` files so their examples use the hardened credential-handling method rather than reproducing the insecure pattern. - Revoke and replace any key suspected of having been exposed through process monitoring.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill's metadata and guidance claim it can provide web embeddings, latest news, and current information, but the documented API call does not actually implement clear web retrieval semantics and instead invokes a chat completions endpoint with ambiguous tool usage. This mismatch is dangerous because it can cause the agent to route ordinary information-seeking requests, including potentially sensitive prompts, to an external third-party service under false assumptions about capability and scope.

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.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The description uses broad phrases such as handling latest news and current information, which can cause the orchestration layer to invoke this skill for many generic user requests. That increases the chance of unnecessary external transmission of user content and use of a third-party API in situations where the user did not explicitly request it.

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/chat/completions" \
  -H "Authorization: Bearer $ZHIPU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
90% confidence
Finding
The documented curl command transmits user-supplied query content and an authorization bearer token to an external service. Even though this is the skill's intended function, it is still a real security concern because the skill is framed broadly enough to be invoked for general information requests, creating a risk of exfiltrating sensitive prompts or metadata to a third party.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The 'When to Use' section lists highly ambiguous triggers like 'look up' and 'find information about', which are common phrases for general assistance rather than a narrowly scoped embedding skill. In context, this makes accidental invocation and third-party data disclosure more likely, especially because the skill sends content to an external API.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The manifest and headings describe 'web embeddings' and 'embeddingsing the internet' (L03, L09-L11), which suggests an embeddings-focused capability. But the actual example call uses `/chat/completions` with a user message and a `web_embeddings` tool (L40-L47), which is a chat/tool-invocation flow for retrieval rather than a straightforward embeddings API call; this is a documentation-to-behavior mismatch within the skill file.

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/chat/completions" \
  -H "Authorization: Bearer $ZHIPU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
84% confidence
Finding
This skill sends user-supplied query content and an API credential to an external third-party endpoint. External transmission is expected for this skill's purpose, but it is still a real security/privacy concern because prompts may contain sensitive data and the skill encourages broad use for information lookup.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger phrases are broad enough that the skill may be invoked for generic requests about finding information or recent events, increasing the chance of unintentional external calls. In a system with multiple skills or sensitive data handling, overbroad invocation can route user content to a third-party API without sufficient user intent or review.

External Transmission

Medium
Category
Data Exfiltration
Content
input: $text
    }')

RESULT=$(curl -s --proto =https --tlsv1.2 -m 30 -X POST "https://open.bigmodel.cn/api/paas/v4/embeddings" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d "$PAYLOAD")
Confidence
89% confidence
Finding
This code performs intentional external transmission of supplied text to the Zhipu embeddings endpoint. Although the HTTPS configuration is reasonable and there is no obvious command injection, the security issue is that arbitrary input content leaves the local trust boundary and is exposed to a third-party service, which can create privacy, compliance, and data-handling risks.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The manifest says this skill should be used for 'web embeddings, latest news, or needs current information,' which implies some capability to access or retrieve current web content. In the code, the only remote operation is a POST to Zhipu's embeddings endpoint using caller-provided text, and the script returns an embedding vector; it never fetches web pages, searches the internet, or accesses current information.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script sends raw user-provided text to a third-party API over the network without any visible user-facing notice, consent gate, or input classification. In skill contexts, this is dangerous because prompts may contain secrets, personal data, or proprietary content that users do not expect to be transmitted off-platform to an external provider.

Intent-Code Divergence

Low
Confidence
91% confidence
Finding
In the 'What's Safe' section, L64 says 'sensitive info not leaked', which reads as a broad safety claim about secret handling. However, L22 and L69 explicitly acknowledge that the API key is visible in `ps aux`, so the documentation internally contradicts itself about whether sensitive information can leak.

Intent-Code Divergence

Low
Confidence
79% confidence
Finding
The inline file comment identifies the script as an embeddings script, which matches the implementation. That directly conflicts with the broader documented intent in the manifest that frames the skill as suitable for 'the internet,' 'latest news,' or 'current information,' none of which are performed here.