Back to skill

Security audit

GLM-OCR-Table

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to do what it says: it sends user-selected images or PDFs to ZhiPu's GLM-OCR API for extraction and does not show hidden persistence or unrelated behavior.

Install only if you are comfortable sending selected images or PDFs, and your ZHIPU_API_KEY, to ZhiPu's GLM-OCR service. Do not use it for highly sensitive documents unless that provider exposure is acceptable, and prefer skill-level key configuration if you do not want the key shared across 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:

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 108)May include surrounding context.

md
4. **IF API fails** — Display the error message and STOP immediately
5. **NO fallback methods** — Do NOT attempt table 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
91% confidence
Finding

The skill declares capabilities that imply environment access, file read/write, and network use, but does not explicitly constrain or document tool scope via permissions or allowed-tools. In practice, this increases the risk that a host agent grants broader-than-necessary access, enabling unintended file access, outbound requests, or data exposure if the skill is misused or later modified.

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 52)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 52)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 / 配置方式(任选一种):**

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module docstring says 'Command-line interface for GLM-OCR vision model' and usage examples present a generic OCR CLI. Later help text also states 'Extract text from images and PDFs', which conflicts with the skill's stated intent of table recognition and extraction into Markdown.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The tool transmits user-supplied document content to an external network service for processing. External transmission is core to the feature, but in this skill context it is still security-relevant because sensitive local files may leave the system and the code does not prominently surface that fact at the point of use.

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 manifest describes a skill focused on recognizing and extracting tables from images and PDFs into Markdown. However, the main API is named extract_text, the CLI advertises 'Extract text from images and PDFs', and the code returns generic OCR text from md_results without any table detection, table-only filtering, or spreadsheet-specific handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

When given a local file, the skill base64-encodes the full contents and sends them to a third-party OCR service without an explicit warning or consent checkpoint. In a skill context, users may assume local processing, so this can cause unintended disclosure of sensitive documents, images, or PDFs to an external provider.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The code creates parent directories and writes JSON output to the user-specified path. Although a success message is printed after writing, there is no advance warning in the interface description that using --output will create or overwrite a local file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.