Back to skill

Security audit

GLM-OCR-Formula

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed ZhiPu GLM-OCR integration that uploads user-selected images or PDFs for OCR, with no evidence of hidden persistence, credential theft, or destructive behavior.

Install only if you are comfortable sending the selected image, PDF, or remote document URL to ZhiPu's GLM-OCR service using your ZHIPU_API_KEY. Avoid using it on confidential documents unless that provider and account setup are approved for the data, and use skill-level API-key configuration if you do not want the key shared with other ZhiPu skills.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (11)

Tainted flow: 'timeout' from os.getenv (line 147, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/glm_ocr_cli.py (reported line 150)May include surrounding context.

python
timeout = float(os.getenv("GLM_OCR_TIMEOUT", str(DEFAULT_TIMEOUT)))

    try:
        resp = requests.post(api_url, json=payload, headers=headers, timeout=timeout)
    except requests.Timeout:
        raise RuntimeError(f"API request timed out after {timeout}s")
    except requests.RequestException as e:

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documented purpose is narrow formula OCR, but the described behavior supports general layout parsing, arbitrary text extraction, remote URL fetching, and processing arbitrary local files. This mismatch can mislead users and reviewers, causing them to approve or invoke a skill with broader data-exfiltration and document-processing power than its title and description suggest.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · SKILL.md (reported line 109)May include surrounding context.

md
4. **IF API fails** — Display the error message and STOP immediately
5. **NO fallback methods** — Do NOT attempt formula extraction any other way

### 📋 Output Display Rules / 输出展示规则

After running the script, present the OCR result clearly and safely.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/glm_ocr_cli.py (reported line 62)May include surrounding context.

python
def get_config() -> tuple[str, str]:
    """
    Get API key from environment and use fixed official API URL.

    Returns:
        tuple of (api_url, api_key)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises capabilities that include environment-variable access, local file handling, file output, and network access, but it does not declare explicit tool scope or permissions. That weakens sandboxing and user visibility, increasing the chance that a skill can access sensitive local content or make outbound requests beyond what users expect.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

md
脚本通过 `ZHIPU_API_KEY` 环境变量获取密钥,可与其他智谱技能复用同一个 key。
This script reads the key from the `ZHIPU_API_KEY` environment variable. Reusing the same key across Zhipu skills is optional.

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

**Setup options / 配置方式(任选一种):**

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

md
脚本通过 `ZHIPU_API_KEY` 环境变量获取密钥,可与其他智谱技能复用同一个 key。
This script reads the key from the `ZHIPU_API_KEY` environment variable. Reusing the same key across Zhipu skills is optional.

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

**Setup options / 配置方式(任选一种):**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill sends user-provided URLs or locally encoded file contents to an external vendor API, but the interface does not provide an explicit user-facing disclosure at the point of use. For OCR on PDFs and images, this can expose sensitive document contents, making the omission materially important in this skill context.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/glm_ocr_cli.py (reported line 150)May include surrounding context.

python
timeout = float(os.getenv("GLM_OCR_TIMEOUT", str(DEFAULT_TIMEOUT)))

    try:
        resp = requests.post(api_url, json=payload, headers=headers, timeout=timeout)
    except requests.Timeout:
        raise RuntimeError(f"API request timed out after {timeout}s")
    except requests.RequestException as e:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is advertised as formula extraction, but the implementation performs general OCR and can expose broader layout parsing output, which increases the chance users submit documents believing only formulas will be processed. This mismatch can lead to over-collection and unintended disclosure of surrounding document content to the external OCR service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code and CLI documentation describe generic text extraction rather than formula-only LaTeX extraction, contradicting the stated skill purpose. This creates a deceptive trust boundary for users and can cause them to expose more document data than intended to a third-party API.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.