Back to skill

Security audit

WeChat Group Operator

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its WeChat posting purpose, but it needs review because live sends rely on an unverified external sender script and can post automatically to enabled groups.

Install only if you understand that it can send real WeChat group messages from the local desktop session. Review and edit the group whitelist and content pools first, run dry runs, avoid cron until stable, and verify the external sender script path is trusted and protected from modification.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Warning
Location
scripts/wechat_group_operator.py:12
Finding

Unvalidated Execution of an External Sender Script

Content
View full analysis

Vulnerability Details

File Location: scripts/wechat_group_operator.py, lines 12 and 75–88
Vulnerability Type: Unvalidated execution of a mutable external tool
Risk Level: Medium

Vulnerable Code:

python
SENDER_SCRIPT = Path(r"C:\Users\Lenovo\.openclaw\workspace\skills\wechat-desktop-sender\scripts\wechat_send.py")
python
def send_to_group(group_name, message, dry_run=False):
    cmd = [
        sys.executable,
        str(SENDER_SCRIPT),
        "--to",
        group_name,
        "--message",
        message,
        "--verify-title",
    ]
    if dry_run:
        return {"cmd": cmd, "stdout": "DRY_RUN", "returncode": 0}

    result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", errors="replace")
    return {
        "cmd": cmd,
        "stdout": result.stdout,
        "stderr": result.stderr,
        "returncode": result.returncode,
    }

Technical Analysis

The skill invokes a Python file located outside the reviewed project and assumes that the file is the legitimate WeChat sender. Before execution, it does not validate the external file's canonical path, ownership, permissions, cryptographic hash, signature, or provenance.

Although the subprocess call uses an argument list rather than a shell and therefore does not expose a direct shell-injection flaw, the external script itself becomes an unverified executable trust boundary. A local actor or compromised component with write access to that path could replace or modify wechat_send.py. The next non-dry-run invocation would execute the substituted Python code with the same operating-system identity and privileges as this skill.

The hard-coded, user-specific path also makes the selected implementation environment-dependent and prevents the audited package from controlling which exact sender code is executed.

Attack Path

  1. An attacker gains write access to `C:\Users\L ...[truncated 1272 chars]
Remediation
View remediation

Remediation Suggestions

  1. Bundle the sender implementation inside the reviewed package where feasible, and audit it together with this skill.
  2. If an external sender is required, obtain its location from a trusted, access-controlled configuration rather than a user-specific hard-coded path.
  3. Resolve the configured path to its canonical form and verify that it remains under an explicitly approved directory.
  4. Verify file and parent-directory ownership and permissions. Refuse execution when untrusted users or components can modify them.
  5. Pin an approved cryptographic hash or verify a digital signature before every execution, and fail closed on mismatch.
  6. Run the sender with the minimum necessary operating-system privileges and isolate it from unrelated files, secrets, and network resources where practical.
  7. Log the canonical path and verified sender version or digest to support incident investigation.
  8. Retain the argument-array subprocess invocation and do not enable shell=True.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

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

md
- group whitelist config
- content pools for questions / followups / cases
- post history to reduce repeats
- execution script for one action at a time
- compatibility with OpenClaw cron jobs

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises automation that relies on reading and writing local files and invoking a Python script, but it does not declare any explicit tool scope or permissions. This creates a least-privilege and transparency problem: an agent or runtime may grant broader access than users expect, increasing the chance of unintended file modification or shell execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The action templates hard-code Chinese phrases for morning, afternoon, and evening messages, indicating the skill outputs content in a specific language by default. The file does not offer a language choice or explain a justified region-specific requirement, which creates a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The code can send messages to one or many enabled WeChat groups immediately via subprocess without any interactive confirmation, per-group approval, or explicit safety prompt. In an automation context, this increases the chance of unintended mass messaging, misuse through incorrect scheduling or configuration, and reputational or privacy harm if the wrong group receives content.

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/wechat_group_operator.py (reported line 88)May include surrounding context.

python
if dry_run:
        return {"cmd": cmd, "stdout": "DRY_RUN", "returncode": 0}

    result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", errors="replace")
    return {
        "cmd": cmd,
        "stdout": result.stdout,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This JSON file hard-codes all user-facing prompt text in Chinese across multiple entries. Because SQP-3 applies to all file types and covers language/locale policy violations, forcing a single language without any visible opt-in or justification is a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This JSON file contains user-facing natural-language content exclusively in Chinese across multiple question entries, but there is no indication that the skill is limited to Chinese-speaking users or that language selection is user-configurable. Under the language/locale policy, forcing a specific language without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This JSON configuration uses Chinese-language group names and topic labels throughout, which indicates the skill is configured for a specific language/locale. Because there is no visible opt-in, alternative locale, or documented justification in this file, it may violate the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file includes natural-language example values such as a Chinese group name and Chinese topic labels, which can imply a fixed language/locale behavior. Because the file does not explain that the skill is China/Chinese-specific or offer a language choice, it may conflict with the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script persistently stores group names, message content, action type, topic, and timestamps in post_history.json without any disclosure, minimization, or protection controls shown in the code. If the host is shared or compromised, this creates a readable audit trail of communications and group metadata that may expose sensitive operational or personal information.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.