Back to skill

Security audit

WeCom文件检测

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to retrieve WeCom chat files, but it can broadly list, read, and copy local inbound attachments without clear conversation scoping or confirmation.

Install only if you are comfortable with the agent listing and reading files from the local WeCom inbound directory. Before use, require a specific current attachment or filename, avoid recency-based selection, and confirm before opening or copying any file into companywork/.

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:19
Finding

Unscoped Access to Shared Inbound Attachments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 19-23, 31-35, and 58-65
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation
Risk Level: Medium

Vulnerable Code

markdown
### 1. 检测最新文件

当没有明确文件名时,扫描 inbound 目录获取最新文件:

```bash
ls -lt ~/.openclaw/media/inbound/ | head -20
text

```markdown
### 3. 文件内容读取

根据文件类型选择读取方式:
- 文本文件:直接 cat
- CSV/Excel:转换为表格
- 图片:使用 image tool 识别
- Word/PDF:使用 markitdown 或 minimax-ocr
markdown
## 触发场景

- 用户说"获取文件"
- 用户说"发送附件"
- 用户说"看看有什么文件"
- 用户上传文件后没有反应
- 用户提到某个具体项目但没有附文件

Technical Analysis

The skill directs the agent to enumerate ~/.openclaw/media/inbound/ whenever the user does not provide a specific filename. It may then read selected files directly or process them through document, spreadsheet, image, or OCR tools.

The trigger conditions are broad enough to activate when no attachment was supplied, including when a user merely asks what files exist or mentions a project without attaching a file. No instruction binds candidate files to the current user, message, conversation, or trusted attachment identifier. There is also no authorization check or confirmation step before file content is accessed.

If the inbound directory contains attachments from multiple conversations, users, or projects, selecting files according to recency rather than ownership can cross a confidentiality boundary. This violates least privilege because fulfilling a request concerning one attachment does not require access to unrelated inbound files.

Attack Path

  1. A user asks the agent to “get a file,” “show available files,” or refers to a project without supplying an attachment.
  2. The skill activates and runs:
    bash
    ls -lt ~/.openclaw/media/inbound/ | head -20
    
  3. The directory listing reveals recent filenames and associated metadata from the shared inbound directory.
  4. In the absence of a conv ...[truncated 1378 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require a trusted attachment identifier tied to the current message or conversation. Do not select files based only on recency.
  2. Restrict file access to a per-user or per-conversation directory rather than the shared inbound directory.
  3. If no attachment is associated with the current request, ask the user to upload or explicitly select a file instead of enumerating directory contents.
  4. Validate that the resolved file path belongs to the authorized conversation scope before listing, reading, converting, copying, or returning its contents.
  5. Avoid exposing raw directory listings. If selection is unavoidable, show only sanitized metadata for files already proven to belong to the current conversation.
  6. Require explicit user confirmation before opening a file or copying it into companywork/.
  7. Enforce an allowlist of archival destinations, restrictive filesystem permissions, retention limits, and audit logging for file reads and copies.
  8. Treat inbound documents as untrusted content when using converters or OCR tools. Use sandboxing, resource limits, patched parsers, and non-executable processing modes.
  9. Define deterministic behavior for ambiguous requests: refuse access when ownership or conversation association cannot be established.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
Findings (7)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation phrases are very broad and map to common everyday speech about files or attachments, making accidental activation likely. In this skill, activation can lead to scanning a local inbound directory and reading user files, so ambiguous triggering materially increases the chance of unintended access to sensitive content.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown trigger examples do not define clear boundaries for when the skill should activate versus when ordinary conversational mentions of files should be ignored. Given the skill’s ability to enumerate and read files from a local directory, vague triggers create a direct risk of unrequested data access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill describes reading and copying user files but does not provide an explicit warning that it will access local chat-delivered files or potentially modify data state by copying them elsewhere. Users may not realize that normal conversation about attachments could cause local filesystem inspection and persistence of sensitive materials.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill’s stated purpose is detecting and retrieving WeCom chat files from the inbound directory, but the documentation expands behavior to creating directories and copying files into companywork/. That broadens the skill from read/retrieve into persistent file modification and data propagation, which can cause unintended retention or duplication of potentially sensitive files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The archival/copy instructions are not necessary to fulfill the declared function of obtaining chat-transferred files. Because they enable persistent duplication into another workspace, they introduce unnecessary data handling risk, including accidental disclosure, retention of sensitive attachments, and unauthorized file placement.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The documented use of mkdir and cp creates persistent artifacts in companywork/, extending the lifetime and spread of files beyond the original inbound location. This persistence increases exposure if the copied files contain sensitive business or personal data, and it is especially risky because the archival behavior is presented as a routine step rather than an exceptional, user-approved action.

Content

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

重要文件应存档到 companywork/ 相关目录:

bash
mkdir -p companywork/AI赋能计划/
cp "源文件" "companywork/目标目录/"

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Several trigger scenarios are subjective, such as inferring intent when a user mentions a project but does not provide a file. That encourages the agent to proactively search for files without a sufficiently explicit request, increasing the risk of over-collection and privacy violations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.