Back to skill

Security audit

Wechat Workflow

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent for WeChat publishing automation, but it handles publishing credentials and system changes in ways users should review carefully before installing.

Install only if you are comfortable giving the skill WeChat Official Account API credentials and allowing it to create drafts, write persistent files under ~/.openclaw/workspace, contact WeChat/Sogou, and possibly install a global npm package. Avoid entering real secrets on the command line, rotate any secrets already printed in logs, and review each draft before public publication.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T08 · Insecure Dependencies

Warning
Location
scripts/publish_and_verify.py:22
Finding

Automatic Global Installation of an Unpinned npm Dependency

Content
View full analysis
bool: if shutil.which("wenyan") is None: print(f"{RED}wenyan-cli 未安装,正在安装...{NC}") try: subprocess.run(["npm", "install", "-g", "@wenyan-md/cli"], check=True, capture_output=False) print(f"{GREEN}wenyan-cli 安装成功!{NC}") except (subprocess.CalledProcessError, FileNotFoundError): print(f"{RED}安装失败!请手动运行: npm install -g @wenyan-md/cli{NC}") return False return True ``` ### Technical Analysis The publishing script automatically installs the latest available version of `@wenyan-md/cli` from the npm registry when the `wenyan` executable is unavailable. The dependency is not pinned to an audited version, and no package integrity value is verified. npm packages can execute lifecycle scripts during installation. Therefore, a compromised package release, maintainer account, transitive dependency, or registry response could cause arbitrary code to run with the permissions of the user executing the Skill. The global `-g` installation also modifies the user's global npm environment rather than limiting the dependency to an isolated project directory. The resulting executable is subsequently invoked with an environment containing `WECHAT_APP_ID` and `WECHAT_APP_SECRET`, increasing the sensitivity of the dependency trust boundary. ### Attack Path 1. An attacker compromises `@wenyan-md/cli`, one of its transitive dependencies, or an authorized package publisher. 2. The attacker publishes a malicious version or adds a malicious installation lifecycle script. 3. A user without an existing `wenyan` executable invokes `publish_and_verify.py`. 4. `check_wenyan()` downloads and globally installs the current package version without confirmation, version pinning, or ...[truncated 730 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/add.py:28
Finding

WeChat Credentials Are Accepted Through Process Arguments and Printed in Plaintext

Content
View full analysis
...") print("例: python add.py wechat '微信公众号' appid=wxd9f577d56948e564 appsecret=xxx") sys.exit(1) key = sys.argv[1] name = sys.argv[2] fields = {} for arg in sys.argv[3:]: if "=" in arg: k, v = arg.split("=", 1) fields[k.strip()] = v.strip() ``` ### Technical Analysis The credential-management interface requires sensitive values such as `appsecret` to be supplied as command-line arguments. Depending on the operating system and shell configuration, command arguments may be exposed through: - Shell history - Process inspection tools - Process accounting - Terminal session recording - Automation and CI logs - Agent execution transcripts After storage, `add()` calls `printFields()`, which prints every stored field without recognizing or masking secret values. This exposes the full AppSecret to terminal output and any system that captures stdout. Although `list.py` masks values, that protection does not apply to the initial credential-entry workflow. ### Attack Path 1. A user follows the documented usage and invokes `add.py` with `appsecret=...` in the command line. 2. The shell may preserve the complete command in its history. 3. While the comm ...[truncated 915 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/add.py:14
Finding

Secret File Permissions Are Applied Only After a Non-Atomic Write

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (41)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Credential deletion and management utilities are unrelated to the advertised publishing automation and create opportunities for destructive or confusing side effects in shared local state. In a broadly triggered skill, this expands the blast radius beyond content processing into secret lifecycle operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Credential deletion and management utilities are unrelated to the advertised publishing automation and create opportunities for destructive or confusing side effects in shared local state. In a broadly triggered skill, this expands the blast radius beyond content processing into secret lifecycle operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Credential deletion and management utilities are unrelated to the advertised publishing automation and create opportunities for destructive or confusing side effects in shared local state. In a broadly triggered skill, this expands the blast radius beyond content processing into secret lifecycle operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Credential deletion and management utilities are unrelated to the advertised publishing automation and create opportunities for destructive or confusing side effects in shared local state. In a broadly triggered skill, this expands the blast radius beyond content processing into secret lifecycle operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Credential deletion and management utilities are unrelated to the advertised publishing automation and create opportunities for destructive or confusing side effects in shared local state. In a broadly triggered skill, this expands the blast radius beyond content processing into secret lifecycle operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Credential deletion and management utilities are unrelated to the advertised publishing automation and create opportunities for destructive or confusing side effects in shared local state. In a broadly triggered skill, this expands the blast radius beyond content processing into secret lifecycle operations.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger phrases include generic requests like writing, continuing, or expanding text, which can match ordinary conversations unrelated to WeChat publishing. Because the skill also has shell, network, file-write, and secret-handling behavior, broad activation materially increases the chance of unintended execution and overbroad access.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The skill documents writing WeChat AppID/AppSecret to a persistent local secrets file in a shared workspace path. Persistent credential storage is sensitive because compromise of that file, weak permissions, or unintended reuse by other skills/processes can expose publishing credentials and enable unauthorized API access.

Content

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

md
| 文件 | 用途 |
|------|------|
| `~/.openclaw/workspace/secrets.json` | 存储微信公众号 AppID/AppSecret(可选,TOOLS.md 也支持) |
| `~/.openclaw/workspace/wechat-monitor.json` | 文章追踪状态数据 |

## 外部网络调用

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The documented add.py flow takes secrets on the command line and stores them locally, which risks exposure through shell history, process listings, logs, and local files. This is a classic credential-handling anti-pattern and is especially dangerous in multi-user or monitored environments.

Content

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

凭证配置

方式 1:secrets.json(推荐)

bash
python scripts/add.py wechat "微信公众号" appid=YOUR_APPID appsecret=YOUR_APPSECRET

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The skill states it will prefer secrets.json and fall back to TOOLS.md, meaning it may read credentials from local files beyond explicit runtime environment variables. Expanding the credential search surface increases the chance of unintended secret ingestion from files the user did not expect this skill to parse.

Content

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

export WECHAT_APP_SECRET=your_app_secret

text

> 优先从 `secrets.json` 读取,若不存在则 fallback 到 TOOLS.md。

**IP 白名单**:运行前需将本机公网 IP(`curl ifconfig.me` 查询)添加到微信公众号后台 → 开发 → 基本配置 → IP 白名单。

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script saves credentials to a local secrets file and immediately prints all stored fields, including sensitive values, to stdout via printFields(). This can expose app secrets in terminal history, logs, CI output, screen recordings, or shoulder-surfing, which is especially risky for a workflow that manages publication and platform credentials.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

Referencing a general secrets.json path indicates the skill is designed to access local credentials directly. In agent workflows, direct filesystem secret access is sensitive because it can retrieve unrelated secrets without granular user approval.

Content

Scanner excerpt · scripts/publish_and_verify.py (reported line 35)May include surrounding context.

python
def load_credentials() -> tuple[str, str]:
    """优先从 secrets.json 读取凭证,fallback 到 TOOLS.md"""
    app_id, app_secret = "", ""
    secrets_file = os.path.expanduser("~/.openclaw/workspace/secrets.json")

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The existence check for secrets.json is part of a workflow that opportunistically accesses local secrets. Even before reading the file, this behavior expands the skill's authority beyond document publishing into local secret discovery.

Content

Scanner excerpt · scripts/publish_and_verify.py (reported line 37)May include surrounding context.

python
def load_credentials() -> tuple[str, str]:
    """优先从 secrets.json 读取凭证,fallback 到 TOOLS.md"""
    app_id, app_secret = "", ""
    secrets_file = os.path.expanduser("~/.openclaw/workspace/secrets.json")

    # 优先从 secrets.json 读取
    if os.path.isfile(secrets_file):

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

This line opens and parses a shared secrets file to obtain credentials, which is a direct credential-access behavior. In the context of an automation skill, this is dangerous because it normalizes broad local secret access and could be repurposed to read additional sensitive material.

Content

Scanner excerpt · scripts/publish_and_verify.py (reported line 39)May include surrounding context.

python
app_id, app_secret = "", ""
    secrets_file = os.path.expanduser("~/.openclaw/workspace/secrets.json")

    # 优先从 secrets.json 读取
    if os.path.isfile(secrets_file):
        with open(secrets_file, encoding="utf-8") as f:
            secrets = json.load(f)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Printing that credentials were loaded from secrets.json does not expose the secret values directly, but it confirms the presence and use of a sensitive secret source. This can aid an attacker or leak operational details in logs, though the primary issue remains the underlying credential access pattern.

Content

Scanner excerpt · scripts/publish_and_verify.py (reported line 47)May include surrounding context.

python
app_id = secrets["wechat"].get("appid", "")
            app_secret = secrets["wechat"].get("appsecret", "")
            if app_id and app_secret:
                print(f"{YELLOW}从 secrets.json 读取微信公众号凭证{NC}")
                return app_id, app_secret

    # Fallback 到 TOOLS.md

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/publish_and_verify.py (reported line 93)May include surrounding context.

python
print("")

    app_id, app_secret = load_credentials()
    env = os.environ.copy()
    if app_id:
        env["WECHAT_APP_ID"] = app_id
    if app_secret:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The command executed on Windows incorporates externally influenced parameters into a shell command, enabling tool parameter abuse or command injection if escaping fails. In this skill, filepath is user-supplied and theme/highlight are CLI-controlled, so the attack surface is directly exposed to the caller.

Content

Scanner excerpt · scripts/publish_and_verify.py (reported line 106)May include surrounding context.

python
def cmd_escape(s):
            return str(s).replace("^", "^^").replace("&", "^&").replace("%", "^%").replace("<", "^<").replace(">", "^>").replace("|", "^|").replace('"', '""')
        cmd_str = " ".join(f'"{cmd_escape(p)}"' for p in cmd_parts)
        result = subprocess.run(cmd_str, check=False, env=env, shell=True)
    else:
        # Unix: use list form without shell
        result = subprocess.run(cmd_parts, check=False, env=env)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/add.py (reported line 6)May include surrounding context.

python
import sys; sys.stdout.reconfigure(encoding='utf-8')
import os, json, stat

SECRETS_FILE = os.path.expanduser("~/.openclaw/workspace/secrets.json")

def load():
    if os.path.exists(SECRETS_FILE):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/get.py (reported line 6)May include surrounding context.

python
import sys; sys.stdout.reconfigure(encoding='utf-8')
import os, json, stat

SECRETS_FILE = os.path.expanduser("~/.openclaw/workspace/secrets.json")

def load():
    if os.path.exists(SECRETS_FILE):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/list.py (reported line 6)May include surrounding context.

python
import sys; sys.stdout.reconfigure(encoding='utf-8')
import os, json, stat

SECRETS_FILE = os.path.expanduser("~/.openclaw/workspace/secrets.json")

def load():
    if os.path.exists(SECRETS_FILE):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/remove.py (reported line 6)May include surrounding context.

python
import sys; sys.stdout.reconfigure(encoding='utf-8')
import os, json, stat

SECRETS_FILE = os.path.expanduser("~/.openclaw/workspace/secrets.json")

def load():
    if os.path.exists(SECRETS_FILE):

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises capabilities that require environment access, filesystem writes, network calls, and shell execution, but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates an authorization gap where a broadly triggered skill could perform sensitive actions without clear user visibility or least-privilege constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill description is written entirely in Chinese and presents the workflow as tailored to Chinese公众号 content generation and publishing, without offering any language or locale choice. Under the stated policy, forcing a specific language or locale without user opt-in is a natural-language policy concern unless the regional constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The one-shot example asks the agent to write and publish in a single step, encouraging automatic chaining of content generation, credential use, network calls, and state changes. For an automation skill with sensitive side effects, this reduces meaningful user review and increases the chance of accidental publication or secret use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints secret fields directly to stdout and, when no field is specified, dumps all key/value pairs for the selected secret entry. This creates a clear risk of credential exposure through terminal history, logs, screenshots, shell piping, or accidental operator misuse, especially in an automation workflow that likely handles API tokens for publishing and tracking.

Content

No source excerpt is available for this finding.