Back to skill

Security audit

Feishu Image Sender

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with sending images to Feishu, but it needs review because it can transmit local files externally with broad activation and weak path/input safeguards.

Review before installing. Use this only when users explicitly ask to send specific images to Feishu, verify the exact file paths before upload, avoid sensitive screenshots or documents, and prefer a version that requires confirmation, restricts paths to the workspace after realpath checks, and serializes message instructions safely.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
send-image.sh:8
Finding
Workspace Path Traversal Can Expose Images Outside the Intended Directory<![CDATA[ ## Vulnerability Details **File Location**: `send-image.sh`, lines 8-25 **Vulnerability Type**: Path traversal and insufficient filesystem boundary validation **Risk Level**: Medium ### Vulnerable Code ```bash WORKSPACE="${OPENCLAW_WORKSPACE:-$HOME/.openclaw/workspace}" IMAGE_NAME="$1" MESSAGE="${2:-发送图片}" # Check arguments if [ -z "$IMAGE_NAME" ]; then exit 1 fi # Build the complete path IMAGE_PATH="$WORKSPACE/$IMAGE_NAME" # Check whether the file exists if [ ! -f "$IMAGE_PATH" ]; then exit 1 fi ``` The resulting path is subsequently included in the generated messaging instruction: ```bash echo "message({" echo " action: \"send\"," echo " channel: \"feishu\"," echo " message: \"$MESSAGE\"," echo " media: \"$IMAGE_PATH\"" echo "})" ``` ### Technical Analysis The script concatenates the caller-controlled `IMAGE_NAME` directly with the configured workspace path. It does not canonicalize the resulting path or verify that the canonical target remains beneath the canonical workspace directory. The `-f` check only verifies that the resulting path resolves to a regular file. It does not prevent traversal components such as `../`, nor does it prevent a symbolic link inside the workspace from resolving to a file outside the workspace. For example, an input resembling the following can resolve outside the intended directory: ```text ../../private/secret.png ``` If the resolved target exists, is readable by the OpenClaw process, and has one of the permitted filename extensions, the script accepts it and prints its path as the `media` value of a Feishu message instruction. The script does not itself transmit the file. Exploitation therefore requires an Agent or operator to execute the generated instruction. Nevertheless, the generated instruction incorrectly represents an out-of-workspace file as an approved media attachment. ### Attack Path 1. An attacker or untrusted caller supplies an image name containing directory traversal compon ...[truncated 1255 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Canonicalize both the workspace and selected file with `realpath`. 2. Verify that the canonical file path is strictly beneath the canonical workspace path. 3. Reject absolute paths and filename inputs containing directory components if only top-level workspace files are intended. 4. Resolve symbolic links before performing the containment check. 5. Perform the regular-file and extension checks against the canonical target. 6. Avoid relying solely on a filename extension to establish that a file is a valid image. Validate the file's MIME type or decode it with a trusted image library before upload. A hardened containment pattern could resemble: ```bash WORKSPACE_REAL="$(realpath -e -- "$WORKSPACE")" IMAGE_PATH_REAL="$(realpath -e -- "$WORKSPACE/$IMAGE_NAME")" case "$IMAGE_PATH_REAL" in "$WORKSPACE_REAL"/*) ;; *) echo "Error: selected file is outside the workspace" >&2 exit 1 ;; esac if [ ! -f "$IMAGE_PATH_REAL" ]; then echo "Error: selected path is not a regular file" >&2 exit 1 fi ``` If nested directories are unnecessary, additionally require: ```bash if [ "$IMAGE_NAME" != "$(basename -- "$IMAGE_NAME")" ]; then echo "Error: only a filename is permitted" >&2 exit 1 fi ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
send-image.sh:65
Finding
Unescaped Input Can Alter the Generated Messaging Instruction<![CDATA[ ## Vulnerability Details **File Location**: `send-image.sh`, lines 65-69 **Vulnerability Type**: Generated-code injection through missing output encoding **Risk Level**: Medium ### Vulnerable Code ```bash echo "message({" echo " action: \"send\"," echo " channel: \"feishu\"," echo " message: \"$MESSAGE\"," echo " media: \"$IMAGE_PATH\"" echo "})" ``` ### Technical Analysis `MESSAGE` and `IMAGE_PATH` contain caller-influenced values and are inserted into JavaScript-like output without escaping quotation marks, backslashes, control characters, or newlines. Shell parameter expansion inside `echo` does not itself execute command substitutions contained in the expanded values, so this is not direct shell command injection in the script. The vulnerability exists in the generated output: specially crafted values can terminate the intended string literal and add or modify object properties, function arguments, or additional statements. The generated content is explicitly presented as an instruction to execute in OpenClaw. If an Agent or operator copies or evaluates it as executable syntax, the output crosses from untrusted data into a code or tool-invocation context without safe serialization. A malicious message containing quotes and newlines could produce output structurally similar to: ```javascript message({ action: "send", channel: "feishu", message: "legitimate text", media: "/attacker/selected/file.png", message: "continuation", media: "/expected/file.png" }) ``` The exact result depends on the parser and duplicate-property behavior of the environment in which the generated instruction is executed. Inputs capable of producing invalid syntax can also cause denial of service by preventing the instruction from being parsed. ### Attack Path 1. An attacker controls or influences the description argument supplied as `$2`, or provides a permitted filename containing quotation marks or newline characters. 2. The script performs no ou ...[truncated 1183 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct executable tool-call syntax with `echo` and raw user-controlled values. 2. Pass a structured request directly to the messaging API where possible. 3. If serialized output is required, use a trusted JSON serializer that correctly escapes quotes, backslashes, newlines, and control characters. 4. Mark generated output as data rather than an instruction to evaluate. 5. Apply length and character restrictions to filenames and reject control characters. 6. Keep filesystem containment validation separate from output encoding; both protections are required. For example, `jq` can safely serialize the values: ```bash jq -n \ --arg action "send" \ --arg channel "feishu" \ --arg message "$MESSAGE" \ --arg media "$IMAGE_PATH_REAL" \ '{action: $action, channel: $channel, message: $message, media: $media}' ``` The resulting JSON should be consumed as structured data by a trusted integration rather than copied into an `eval`-like execution context. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The skill claims to send images to Feishu, but its documented workflow also searches the local workspace for matching files. That local file enumeration is an additional capability not disclosed in the description, which weakens transparency and can cause users or orchestrators to invoke the skill without realizing it may inspect local files before exfiltrating them to an external service.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The README instructs users to send images and captions to Feishu but does not clearly disclose that both the image content and accompanying text are transmitted to an external third-party service. In a skill that operates on local workspace files, this omission can cause users to unintentionally exfiltrate sensitive screenshots, documents, or metadata beyond the local environment.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill is designed to transmit local image files to an external messaging platform but does not instruct the agent to obtain explicit user confirmation or warn about outbound data transfer. In this context, automatic activation on image filenames makes the risk higher because innocuous mentions of local files could trigger unintended disclosure of workspace contents to Feishu.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The activation rule is overly broad because it triggers not only when a user explicitly asks to send images to Feishu, but also whenever a message contains common image filenames or paths. That can cause unintended invocation of a capability that transmits files to an external service, increasing the risk of accidental data exfiltration or user confusion about why content is being sent.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The description does not clearly warn users that activating this skill will upload image files to Feishu, which is an external platform. Without a clear disclosure, users may invoke the skill without understanding that local or referenced images could be transmitted outside the current environment, creating privacy and data-handling risks.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The natural-language instructions in this file are presented in Chinese, which may impose a language constraint on users. There is no indication that the skill offers an alternative language or that Chinese-only documentation is intentionally required for a region-specific use case.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The operational instructions and examples are presented in Chinese, which can impose a language constraint on users without any stated opt-in or justification. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy violation.