Back to skill

Security audit

VLM Image Helper

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local image-preprocessing helper whose file and base64 behavior matches its stated VLM/OCR purpose, with some ordinary hardening notes but no evidence of malicious behavior.

Install this only if you are comfortable with a local helper reading images you explicitly pass to it and writing processed copies or base64 output. Prefer a virtual environment, use trusted/pinned Pillow installs where possible, avoid running extreme scale factors on large images, and choose output paths carefully for sensitive screenshots or documents.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/image_helper.py:224
Finding

Unbounded Image Scaling Can Cause Resource Exhaustion

Content
View full analysis
Image.Image: """ Scale image by specified factor. Args: img: PIL Image object factor: Scale factor (e.g., 2.0 for 2x zoom) Returns: Scaled image """ if factor <= 0: raise ValueError("Scale factor must be positive") new_size = (int(img.width * factor), int(img.height * factor)) return img.resize(new_size, resample=Image.LANCZOS) ``` The unrestricted factor is exposed through the CLI: ```python scale_group = parser.add_mutually_exclusive_group() scale_group.add_argument('--scale-preset', metavar='NAME', help='Scale by preset (x2, x3, x4)') scale_group.add_argument('--scale', type=float, metavar='FACTOR', help='Scale by factor (e.g., 2 for 2x)') ``` ### Technical Analysis The scaling function verifies only that the factor is positive. It does not enforce a maximum scale factor, output width, output height, total pixel count, or estimated memory requirement. It also does not explicitly reject non-finite values. The caller controls the scaling factor through `--scale`. The same operation can also be supplied through pipeline JSON. The calculated image dimensions grow linearly with the factor, while the number of output pixels and approximate memory requirements grow quadratically. For example, scaling a 4,000 × 4,000 image by a factor of 100 requests an output image containing approximately 160 billion pixels. Pillow may attempt a very large allocation or perform substantial processing before failing. Image input and base64 decoding are also not subject to explicit applicat ...[truncated 1593 chars]
Remediation
View remediation
Image.Image: if not math.isfinite(factor) or factor <= 0 or factor > MAX_SCALE_FACTOR: raise ValueError( f"Scale factor must be finite and between 0 and {MAX_SCALE_FACTOR}" ) new_width = int(img.width * factor) new_height = int(img.height * factor) if ( new_width <= 0 or new_height <= 0 or new_width > MAX_WIDTH or new_height > MAX_HEIGHT or new_width * new_height > MAX_PIXELS ): raise ValueError("Requested output image exceeds resource limits") return img.resize((new_width, new_height), resample=Image.LANCZOS) ``` ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:58
Finding

Unpinned Pillow Installation Produces a Non-Reproducible Dependency Supply Chain

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

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

md
- Another tool needs inline image data instead of a file path: add `--base64`.
- The source image arrives as raw base64 or a data URI: use `--input-mode auto` or force `--input-mode base64` / `data-uri`.

## Input and Output Rules

- Accept a file path, raw base64 string, or data URI as input.
- Return a file with `-o` or return inline base64 with `--base64`.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

该 markdown 文件包含多条会生成输出文件的命令示例,如 -o rotated.png、detail.png、enhanced.png,但附近没有任何提醒说明这些操作会在本地写入文件。根据 SQP-2 对 markdown 文件的要求,涉及可能影响用户数据或系统状态的行为时,应提供基本的用户提示或注意事项。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

When no output path is provided, the tool silently writes the processed image to a temporary file on disk and returns that path. In an image/OCR helper context, inputs may contain sensitive screenshots, documents, or credentials, so unexpected disk persistence can leak data to other local users, backup systems, or later forensic recovery.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.