Back to skill

Security audit

知识学习管理

Security checks for vulnerabilities and agentic risk

Overview

This learning-review skill is mostly purpose-aligned, but it uses broad automatic triggers plus shell-based image fetching/OCR and scheduled persistence in ways users should review before installing.

Review this skill before installing if you use OpenClaw with access to private networks or sensitive notes. Prefer explicit command-style triggers, disable or constrain the OCR URL download path, use unique private temporary directories, restrict web fetching, and confirm where retained JSON data can be deleted or exported.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:65
Finding

Unvalidated Attachment URL Retrieval and Unsafe Temporary File Handling

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 65
Vulnerability Type: Server-Side Request Forgery, unsafe URL handling, and insecure temporary-file usage
Risk Level: Medium

Vulnerable Code

markdown
1. **Download image**: Extract the image URL from the Feishu message and use the `exec` command `curl -o /tmp/ocr_input.png "<image URL>"` to download it

The executable command specified by the Skill is:

bash
curl -o /tmp/ocr_input.png "<image URL>"

Technical Analysis

The Skill directs the Agent to insert an attachment URL into a shell-level curl operation without specifying validation of:

  • The URL scheme
  • The source hostname
  • The resolved IP address
  • Redirect destinations
  • Response size
  • Content type
  • Whether the response is a valid image

Although enclosing the URL in double quotes reduces straightforward shell metacharacter injection, it does not make arbitrary URL retrieval safe. Depending on the installed curl configuration and supported protocols, an attacker-controlled URL could reference internal HTTP services, loopback or link-local addresses, or non-HTTP resources such as file://. Redirects can also be used to move a request from an initially permitted host to a prohibited internal destination if redirect validation is absent.

The destination /tmp/ocr_input.png is a predictable, fixed path. In a shared environment, another process or local user could pre-create it as a symbolic link. Because curl -o opens the destination for writing, this may overwrite a file accessible to the Agent's operating-system identity. Concurrent OCR operations could also overwrite each other's files.

Finally, the downloaded content is passed to ImageMagick and Tesseract later in the documented workflow. Missing size and format validation increases exposure to resource-exhaustion attacks and vulnerabilities in image-processing components.

Attack Path

  1. An attacker sends a Feishu message contain ...[truncated 1830 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict attachment sources

    • Accept only https:// URLs.
    • Allowlist the exact trusted Feishu attachment hostnames.
    • Reject URLs containing user information, unexpected ports, or ambiguous host encodings.
  2. Prevent SSRF

    • Resolve the hostname before connecting.
    • Reject loopback, private, link-local, multicast, reserved, and unspecified IP ranges for both IPv4 and IPv6.
    • Revalidate every redirect destination or disable redirects entirely.
    • Protect against DNS rebinding by binding validation to the actual connection address.
  3. Constrain curl

    • Use protocol restrictions, strict timeouts, and response-size limits.
    • Example defensive baseline:
      bash
      curl \
        --fail \
        --silent \
        --show-error \
        --proto '=https' \
        --max-time 10 \
        --connect-timeout 3 \
        --max-filesize 10485760 \
        --output "$secure_path" \
        -- "$validated_url"
      
    • Do not enable unrestricted redirect following. If redirects are required, validate each destination.
  4. Use secure temporary storage

    • Create a private directory with mktemp -d.
    • Set restrictive permissions such as umask 077.
    • Generate unique filenames for every request.
    • Refuse symbolic links and avoid fixed paths under shared /tmp.
    • Register cleanup so files are removed on success, failure, interruption, and timeout.
  5. Validate downloaded content

    • Enforce a small maximum file size before processing.
    • Verify the MIME type and image signature rather than trusting the extension or response header.
    • Decode the image with a constrained image library before invoking external processors.
    • Reject unsupported formats and unreasonable dimensions.
  6. Sandbox image processing

    • Run ImageMagick and Tesseract with low privileges, resource limits, and no unnecessary network access.
    • Keep both tools and their decoding libraries patched.

...[truncated 307 chars]

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The declared trigger scheme includes broad everyday phrases for activation, increasing the chance the skill runs during ordinary conversation. Over-broad invocation is dangerous here because the skill performs persistent storage, automated classification, and other side effects without strong confirmation gates.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly states that any input containing trigger words enters skill logic and that the main agent does not filter inputs. This creates an unsafe routing rule where normal user text can cause storage, deletion, OCR, or scheduling behavior unintentionally.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Several triggers such as '没有', '进度', '详情', '搜索', and image sending are too generic to safely distinguish from ordinary chat. In a skill with file persistence and automated workflows, generic triggers materially raise the risk of accidental activation and unintended data handling.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to download user-supplied image URLs and process them with shell commands (curl, convert, tesseract, rm). Even if intended for OCR, this expands a note-taking skill into direct command execution and network/file handling, creating SSRF, unsafe file-processing, and command-surface risk if inputs or URLs are attacker-controlled.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The skill includes direct shell cleanup commands as part of its workflow. Although the specific rm -f targets are fixed temp paths, embedding file-deletion commands in skill instructions normalizes unsafe tool use and, in the context of the adjacent shell pipeline, increases the risk of destructive behavior if paths or command construction later become variable.

Content

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

  • OCR 置信度低 → 提示 识别结果可能不够准确,请检查: + 文本
  1. 清理:
    bash
    rm -f /tmp/ocr_input.png /tmp/ocr_prepped.png /tmp/ocr_output.txt
    

边界条件:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill persistently stores knowledge entries, project data, and review history in JSON files without an explicit warning to the user. This is a privacy risk because users may enter sensitive study notes or personal plans without understanding retention and reuse behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The OCR flow downloads user images from external URLs and processes them, but the design does not present any user-facing privacy notice or consent step. Users may not realize images are being fetched, stored temporarily, and transformed, which creates privacy and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The OCR flow hard-codes chi_sim+eng, and the skill’s interaction design and examples assume Chinese prompts and outputs, but the document does not offer a language choice or explain a justified regional restriction. This can violate language/locale policy when users have not opted into a Chinese-only experience.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill manifest describes knowledge management, but the design adds external web fetching for greetings. This increases data exposure and attack surface unnecessarily, because routine skill execution now depends on third-party content and outbound requests unrelated to core functionality.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill performs general external web access to search engines and a third-party API for motivational quotes, which is outside the core knowledge-review scope. Unnecessary outbound access can leak metadata, introduce prompt/content injection from remote pages, and make the skill behavior depend on untrusted external services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The document is entirely written in Chinese and defines classification rules and user-facing result behavior without indicating that language selection is optional. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale-policy issue unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This specification consistently assumes Chinese-language interaction for triggers, commands, and responses, but does not state that the skill is region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.