Back to skill

Security audit

GLM-V-Prompt-Gen

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward visual prompt-generation skill that sends user-provided media to Zhipu's cloud API, with some disclosure and documentation caveats.

Install only if you are comfortable sending provided images or video URLs to Zhipu's API under your ZHIPU_API_KEY. Avoid sensitive local images, private video URLs, and broadly shared API keys; also note that the documented default model appears inconsistent with the code.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (12)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
> ⚠️ Images and videos cannot be used in the same request.
> ⚠️ Videos only support URLs — local paths and base64 are NOT supported.

### 📋 Output Display Rules (MANDATORY)

After running the script, **you must display the full prompt output exactly as returned**. Do not summarize, truncate, or only say "prompt generated". Users need the complete prompt (especially the English prompt) for direct copy/paste.
Confidence
91% confidence
Finding
The instruction to display the full model output exactly as returned, without summarization or filtering, creates a direct prompt-extraction and content-propagation path. If the upstream model returns unsafe, policy-violating, sensitive, or prompt-injected content, the agent is told to relay it verbatim, defeating downstream review and increasing the chance of data leakage or malicious instruction propagation.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
"-m",
        default=OUTPUT_IMAGE,
        choices=[OUTPUT_IMAGE, OUTPUT_VIDEO, "auto"],
        help="Output prompt type: image (default), video, or auto (both)",
    )
    parser.add_argument(
        "--model", default=DEFAULT_MODEL, help="Model name (default: glm-4.6v)"
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares capabilities that imply access to environment variables, file output, and network resources, but it does not define any explicit tool scope or permission boundaries. That makes it harder for a host system or reviewer to constrain what the skill may do, increasing the risk of overbroad execution and unintended access to secrets or external endpoints.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The trigger guidance includes broad phrases like generic prompt-generation requests, which can cause the skill to activate in ordinary conversations where visual analysis or external API use was not intended. Over-triggering can expose user content to unnecessary processing or external transmission and may bypass more appropriate skills or safer defaults.

Whitespace Padding

Medium
Category
Prompt Injection
Content
## Resource Links

| Resource        | Link                                                                                                                              |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **Get API Key** | [https://bigmodel.cn/usercenter/proj-mgmt/apikeys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys)                              |
| **API Docs**    | [Chat Completions / 对话补全](https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E5%AF%B9%E8%AF%9D%E8%A1%A5%E5%85%A8) |
Confidence
70% confidence
Finding
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Session Persistence

Medium
Category
Rogue Agent
Content
This script reads the key from the `ZHIPU_API_KEY` environment variable and shares it with other Zhipu skills.
脚本通过 `ZHIPU_API_KEY` 环境变量获取密钥,与其他智谱技能共用同一个 key。

**Get Key / 获取 Key:** Visit [Zhipu Open Platform API Keys / 智谱开放平台 API Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) to create or copy your key.

**Setup options / 配置方式(任选一种):**
Confidence
72% confidence
Finding
This duplicate finding points to the same underlying issue: persistent, shared use of `ZHIPU_API_KEY` across skills. Reusing one credential across multiple workflows increases the impact of accidental disclosure, unauthorized invocation, or cross-skill abuse.

Session Persistence

Medium
Category
Rogue Agent
Content
This script reads the key from the `ZHIPU_API_KEY` environment variable and shares it with other Zhipu skills.
脚本通过 `ZHIPU_API_KEY` 环境变量获取密钥,与其他智谱技能共用同一个 key。

**Get Key / 获取 Key:** Visit [Zhipu Open Platform API Keys / 智谱开放平台 API Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) to create or copy your key.

**Setup options / 配置方式(任选一种):**
Confidence
72% confidence
Finding
This duplicate finding points to the same underlying issue: persistent, shared use of `ZHIPU_API_KEY` across skills. Reusing one credential across multiple workflows increases the impact of accidental disclosure, unauthorized invocation, or cross-skill abuse.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The output-format instructions require the '内容分析' section to be written in Chinese, even when the material may otherwise call for English output. This enforces a specific language for part of the response without offering the user a choice or documenting a justified locale constraint.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The language-selection rules require the model to choose only Chinese or English automatically and explicitly state that when the determination is unclear, it should prefer Chinese. This imposes a locale choice without user opt-in, which is a natural-language policy issue under the language/locale rule.

External Transmission

Medium
Category
Data Exfiltration
Content
payload["thinking"] = {"type": "enabled"}

    try:
        response = requests.post(
            API_BASE_URL, headers=headers, json=payload, stream=stream, timeout=180
        )
    except requests.exceptions.Timeout:
Confidence
91% confidence
Finding
This skill sends user-supplied images, video URLs, and derived prompt content to an external third-party API. In the context of a visual-analysis skill, such transmission is expected, but it still creates a real data-exposure risk if users provide sensitive local images or internal URLs without clear consent and safeguards.

Intent-Code Divergence

Low
Confidence
92% confidence
Finding
The module docstring at L005-L012 documents a set of supported vision models, but the implementation sets DEFAULT_MODEL to "glm-5v-turbo" at L025, which is not included in that documented list. This is an intent/documentation mismatch that could mislead users about what model the tool actually uses by default.

Intent-Code Divergence

Low
Confidence
98% confidence
Finding
The --model argument help says the default is "glm-4.6v", but the code sets default=DEFAULT_MODEL and DEFAULT_MODEL is "glm-5v-turbo" at L025. This directly contradicts the user-facing documentation embedded in the code and can cause operators to misunderstand runtime behavior.

Static analysis

No suspicious patterns detected.