Back to skill

Security audit

moondream-vision-zc

Security checks for vulnerabilities and agentic risk

Overview

This is a local image-analysis skill, but it needs review because it reads any file path it is given and recommends using image-derived model output as a system prompt.

Review this before installing. Use it only with image files you intentionally choose, avoid sensitive files, verify Ollama is bound to localhost, install dependencies in an isolated environment, and do not pass Moondream output into another model as a system prompt; treat it as untrusted user data instead.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:36
Finding

Unrestricted Local File Ingestion Through User-Controlled Path

Content
View full analysis
str: data = pathlib.Path(path).read_bytes() return base64.b64encode(data).decode("utf-8") def run_moondream(image_path: str, prompt: str = ""): img_b64 = encode_image(image_path) payload = { "model": "moondream", "prompt": prompt, "images": [img_b64], "stream": False, } resp = requests.post(OLLAMA_URL, json=payload) ``` ### Technical Analysis The command treats a user-controlled path as an image and reads the entire referenced file without validating its type, canonical location, size, or symlink status. It therefore permits access to any file readable by the operating-system identity running the Skill. Base64 encoding provides no confidentiality protection. The resulting content is submitted to the fixed loopback Ollama endpoint at `http://127.0.0.1:11434/api/generate`. This transmission is consistent with the declared local image-analysis functionality, and the reviewed code does not send data to an external host. Nevertheless, unrestricted path handling exceeds the minimum access needed to analyze ordinary image files. The documented approximate 5 MB image limit is not enforced before `read_bytes()`, meaning a very large file could also cause excessive memory consumption. ### Attack Path 1. An attacker or untrusted user obtains the ability to provide the `image_path` command argument. 2. The attacker supplies a path to a sensitive file, symlink, device-like file, or excessively large file instead of a legitimate image. 3. `pathlib.Path(path).read_bytes()` reads the complete resource using the Skill process's existing filesystem permissions. 4. The content is Base64-encoded and submitted to the local Ollama service. 5. Depending on the file format and model behavior, sen ...[truncated 625 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:21
Finding

Unpinned Third-Party Python Dependency

Content
View full analysis
Remediation
View remediation

other

Warning
Location
SKILL.md:82
Finding

Untrusted Vision-Model Output Recommended as a System Prompt

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · SKILL.md (reported line 54)May include surrounding context.

md
"images": [img_b64],
        "stream": False,
    }
    resp = requests.post(OLLAMA_URL, json=payload)
    resp.raise_for_status()
    result = resp.json()
    # Ollama returns a stream of tokens; when stream=False we get full response in ``response``

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill reads a local image file, base64-encodes it, and sends it over HTTP to the local Ollama API for processing, but the user-facing documentation does not clearly warn that local image contents are being transmitted to another service. Even though the destination is localhost, this is still a separate networked service boundary and may surprise users handling sensitive images or systems where Ollama is exposed beyond loopback.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The natural-language description and all examples are presented only in Chinese, and the file does not indicate that this locale restriction is optional or region-specific. Under the policy, forcing a specific language without user opt-in can be a language/locale policy violation.

Content

No source excerpt is available for this finding.