Back to skill

Security audit

wecom-workplan-summary

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed team work-plan summarizer, but it handles sensitive business data and users should understand its WeCom and temporary-file behavior before use.

Install only if this fixed WeCom smart sheet is the sheet you intend to summarize and the agent's WeCom MCP credentials are authorized for it. Avoid pasting highly sensitive plans unless you are comfortable with a temporary local file at /tmp/workplan_paste.tsv, and delete that file after use. Treat report inputs as untrusted data, especially if multiple people can edit the sheet.

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
scripts/summary.py:299
Finding

Untrusted Work-Plan Content Is Passed to the AI Agent Without Instruction/Data Separation

Content
View full analysis

Vulnerability Details

File Location: scripts/summary.py:299-356; related agent instructions in SKILL.md:65-76
Vulnerability Type: Indirect prompt injection through untrusted smart-sheet content
Risk Level: Medium

Vulnerable Code

The script extracts work-plan content from externally editable records without validating whether it contains instructions:

python
plan_field = fields.get("今日计划", "")
if isinstance(plan_field, list):
    plan = plan_field[0].get("text", "") if plan_field else ""
elif isinstance(plan_field, dict):
    plan = plan_field.get("text", "")
else:
    plan = str(plan_field)

# 无论是否有计划都记录该人(便于识别未提交)
filtered[name]['计划'].append((date_label, plan.strip()))

It then reproduces the content verbatim in output intended for the AI Agent:

python
lines.append(f"【{name} · {role}】")
for date_label, plan in plans:
    plan_clean = plan.replace('\n', ' / ').strip()
    lines.append(f"  {date_label}: {plan_clean}")
lines.append("")

The Skill directs the Agent to use that output to produce the final report:

text
2. 根据用户指定时间范围调用脚本:

   ```bash
   python3 ~/.openclaw/workspace/skills/wecom-workplan-summary/scripts/summary.py 周度 <week_num> <year>
   python3 ~/.openclaw/workspace/skills/wecom-workplan-summary/scripts/summary.py 月度 <month> <year>
   ```

3. 根据脚本输出生成最终报告(见下方"报告生成规范")

Technical Analysis

Smart-sheet contributors control the contents of fields such as the daily plan. The script treats these values as ordinary strings and places them directly into model-facing output. Replacing newline characters with separators changes presentation only; it does not neutralize natural-language instructions.

The Skill does not establish an explicit trust boundary stating that retrieved or pasted cell values are untrusted data that must never be interpreted as Agent instructions. Consequently, a malicious contributor coul ...[truncated 1983 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add an explicit instruction boundary to SKILL.md: all smart-sheet records and pasted cell values are untrusted data, must be used only as report source material, and must never be followed as instructions.
  2. Wrap each record in clearly labeled data delimiters and state that text inside those delimiters cannot modify Skill rules, request tool calls, or control report structure.
  3. Validate field types and impose reasonable length limits before including values in model-facing output.
  4. Detect and flag instruction-like phrases, role impersonation, requests to ignore prior instructions, and requests for tools or unrelated data. Preserve suspicious content only as quoted source data or exclude it with a visible warning.
  5. Generate a structured serialization format, such as JSON with explicit field names, rather than an instruction-like free-form transcript. Structural encoding alone is not a complete defense and must be combined with the Agent-side trust-boundary instruction.
  6. Restrict edit permissions on the configured smart sheet to authorized team members and retain edit history for incident review.
  7. Add security tests containing adversarial plan cells and verify that they cannot change report scope, omit unrelated records, request tool use, or override the required output format.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (10)

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

The script invokes an external program (wecom_mcp), which is effectively shell/process-execution capability, but that capability is not declared. In a skill system, undeclared process execution expands trust boundaries and can enable unintended data access or tool use beyond what the skill description suggests.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

The script invokes an external program (wecom_mcp), which is effectively shell/process-execution capability, but that capability is not declared. In a skill system, undeclared process execution expands trust boundaries and can enable unintended data access or tool use beyond what the skill description suggests.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The declared Write tool broadens the skill's ability to persist sensitive operational data beyond the immediate conversation. Given the skill processes named employee plans and project details, session persistence materially raises confidentiality risk compared with a purely in-memory summarization flow.

Content

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

md
---
name: wecom-workplan-summary
description: 团队工作计划周度/月度汇总分析。仅当用户**明确提供**了团队工作计划数据(粘贴内容或指向企微智能表格)并要求汇总/分析时触发。典型意图:"这是团队工作计划,帮我看下上周/本周情况"、"我把数据复制过来了,分析一下"、"帮我从企微表格拉取工作计划汇总"。**不触发**:仅提到"周报"、"本周工作"等通用词但未提供数据或未明确指向企微表格。
allowed-tools: Bash(python3:*), Bash(mkdir:*), Write
---

# 团队工作计划汇总技能

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The declared Write tool broadens the skill's ability to persist sensitive operational data beyond the immediate conversation. Given the skill processes named employee plans and project details, session persistence materially raises confidentiality risk compared with a purely in-memory summarization flow.

Content

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

md
---
name: wecom-workplan-summary
description: 团队工作计划周度/月度汇总分析。仅当用户**明确提供**了团队工作计划数据(粘贴内容或指向企微智能表格)并要求汇总/分析时触发。典型意图:"这是团队工作计划,帮我看下上周/本周情况"、"我把数据复制过来了,分析一下"、"帮我从企微表格拉取工作计划汇总"。**不触发**:仅提到"周报"、"本周工作"等通用词但未提供数据或未明确指向企微表格。
allowed-tools: Bash(python3:*), Bash(mkdir:*), Write
---

# 团队工作计划汇总技能

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs writing user-provided team work plan data to /tmp/workplan_paste.tsv without disclosing that the content will be persisted locally. Work plans typically contain employee names, schedules, roles, and project details, so silent local storage increases privacy and data-handling risk if the file is retained, reused, or read by other processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs fetching records from a WeCom smartsheet using a fixed docid and sheet_id, but does not require an explicit user-facing notice that external enterprise data will be accessed. This can cause unauthorized or unexpected retrieval of internal team planning data if the user does not fully understand that the agent will query a live corporate data source.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level docstring presents the script name and usage instructions entirely in Chinese, which imposes a specific language on users. Under the policy, locale or language constraints should either be optional for the user or clearly justified as region-specific; neither is stated here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Hardcoded docid and sheet_id give the skill built-in access to a specific team smart sheet, creating a hidden privileged data source. In this skill's context, that is more dangerous because the advertised purpose is to summarize data explicitly provided by the user, not silently pull from a preauthorized internal dataset.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/summary.py (reported line 45)May include surrounding context.

python
"wecom_mcp", "call", "doc", "smartsheet_get_records",
        json.dumps({"docid": DOCID, "sheet_id": SHEET_ID})
    ]
    result = subprocess.run(cmd, capture_output=True, text=True)
    if result.returncode != 0:
        raise Exception(f"MCP调用失败: {result.stderr}")

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description says it should trigger only when the user explicitly provides workplan data or points to a WeCom smart sheet, but the code defaults to reading a preconfigured table whenever --data is absent. This creates an implicit data-access path that can expose team planning data even when the user did not explicitly authorize or specify that source in the current interaction.

Content

No source excerpt is available for this finding.