Back to skill

Security audit

Auto Image Reader

Security checks for vulnerabilities and agentic risk

Overview

This image-reading skill is useful in concept, but it can automatically inspect the wrong workspace image because it searches broadly and uses weak matching rules.

Install only if you are comfortable with the agent listing visible workspace images to locate uploads. It should be tightened to analyze only the specific image attached to the current message, fail closed when ambiguous, and ask before inspecting images outside explicit user requests.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:22
Finding

Workspace-Wide Image Enumeration and Unverified File Selection

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 22–37, 77–84, and 90–91
Vulnerability Type: Missing authorization boundary and unsafe resource-selection logic
Risk Level: Medium

Vulnerable Instructions

SKILL.md, lines 22–37:

text
### Step 1:查找图片的真实路径
使用 `images_list` 工具,遍历找到对应的图片文件:

images_list(start=0, number=20)

text
在返回结果中找到图片的 `Path` 字段,如:

/workspace/user_input_files/image.png /workspace/imgs/xxx.jpg

text

**匹配逻辑:**
- 如果文件名包含用户消息中的关键词(如用户说"这张图"),匹配
- 如果有多张最新图片,取最新的(按修改时间)
- 如果是唯一的 user_input_files/image.png,直接使用

SKILL.md, lines 77–84:

text
当收到用户图片消息时:
    1. 从消息元数据提取文件名(如 image.png)
    2. 调用 images_list(start=0, number=20)
    3. 在结果中搜索包含该文件名的记录
    4. 找到 → 提取 Path 字段(真实绝对路径)
    5. 调用 images_understand(file=真实路径, prompt=用户问题)
    6. 回答用户

SKILL.md, lines 90–91:

text
- 不能假设消息中的文件名可以直接访问
- images_list 能看到 /workspace 下所有图片的真实路径

Technical Analysis

The Skill instructs the agent to enumerate images visible throughout /workspace and then select a file using filename, uniqueness, or modification-time heuristics. It does not require a trusted attachment identifier, validate that the selected image belongs to the current user or conversation, or restrict discovery to a conversation-specific upload directory.

Filename similarity and file recency are not authorization controls. Generic names such as image.png can occur in multiple sessions, while selecting the most recently modified image may choose a file uploaded by another user. The selected absolute path is subsequently passed to images_understand, and the resulting contents may be disclosed in the response.

This violates least privilege because analyzing one message attachment does not legitimately require visibility into unrelated images throughout the workspace.

Attack Path

  1. A victim or another session places a sensitive image in a location v ...[truncated 1398 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use an authenticated attachment identifier supplied by the current message or platform API rather than discovering files by workspace-wide enumeration.
  2. Resolve attachment identifiers server-side and verify that the resolved file belongs to the current user, conversation, and message before analysis.
  3. Restrict file lookup to a per-conversation or per-request upload directory. Do not allow the Skill to enumerate all images under /workspace.
  4. Require exact identifier matching. Do not use filename substrings, uniqueness, or modification time as authorization or ownership evidence.
  5. Fail closed when attachment resolution is missing or ambiguous. Ask the user to upload the image again rather than selecting the newest candidate.
  6. Pass only validated, canonicalized paths to images_understand, and enforce an allowlisted upload root after resolving symbolic links and path normalization.
  7. Minimize metadata returned by image-listing tools so unrelated filenames and absolute paths are not exposed to the agent.
  8. Add tests covering duplicate filenames, simultaneous uploads, multiple users, stale images, symbolic links, and attempts to reference files from another conversation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill does not clearly disclose to users that it will enumerate image paths and automatically inspect uploaded images, which creates a transparency and consent problem. Because the workflow explicitly calls images_list over available images under /workspace, users may not realize the agent is discovering file locations beyond the raw message attachment reference.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger scope is overly broad because it activates on essentially any image-bearing conversation, which can cause the agent to inspect uploaded images without sufficiently clear user intent. In this skill, that risk is amplified by the automatic follow-on behavior of enumerating available image paths and reading image contents, increasing the chance of unintended data access or privacy violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill hardcodes Chinese prompt text for image analysis and the document consistently instructs behavior in Chinese, but it does not indicate that language should follow user preference. This can violate language/locale policy when users expect another language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.