Back to skill

Security audit

Wechat Publisher Skill Clean

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated WeChat draft-publishing purpose, but it handles powerful account credentials with unsafe documentation and plaintext token storage, so users should review it carefully before installing.

Install only if you are comfortable giving the skill access to a WeChat official account. Use a test account first, avoid pasting real AppSecrets into command lines or committed JSON files, review generated drafts before publishing, remove or change the fixed author/branding, and avoid the sudo/curl installation steps in favor of a least-privilege, pinned install path.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (6)

T03 · Remote Payload Retrieval and Execution

Error
Location
docs/user_guide.md:86
Finding

Privileged Execution of a Mutable Remote Installation Script

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/publish.py:169
Finding

WeChat Bearer Token Stored in a Plaintext Cache

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
docs/user_guide.md:219
Finding

AppSecret Exposed Through Command-Line Arguments and Plaintext Configuration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/publish.py:255
Finding

External News Data Inserted into HTML Without Escaping or Sanitization

Content
View full analysis

📰 AI 新闻早报 | {today_date}

" # 今日摘要(前 5 条) summary = ";".join([news["title"][:30] for news in news_list[:5]]) + "。" html += f"

📰 今日摘要

{summary}

" # 头条新闻(前 2 条) html += "

🔥 头条新闻

" for i, news in enumerate(news_list[:2], 1): html += f"

{i}. 【{news['category']}】{news['title']}

" html += f"

{news['content'][:150]}...

" # 重要更新(第 3-10 条) html += "

📌 重要更新

" for i, news in enumerate(news_list[2:10], 3): html += f"

{i}. {news['title']}

" html += f"

{news['summary'][:120]}...

" # 简短摘要(第 11-15 条) html += "

📝 简短摘要

" for i, news in enumerate(news_list[10:15], 11): html += f"

{i}. {news['title']}

" ``` ### Technical Analysis Article titles, summaries, categories, and content originate from an external news API. They are concatenated directly into HTML without contextual escaping or allowlist sanitization. String truncation does not neutralize markup. An attacker controlling an article or a compromised upstream feed can include HTML fragments within the truncated length. Those fragments become part of the draft submitted to WeChat. The final effect depends on WeChat's server-side sanitizer and rendering behavior. Even if active scripts are stripped, injected links, formatting, deceptive text, images, or tracking resources may survive and alter the publication. ### Attack Path 1. An attacker publishes an article whose title, description, or content contains crafted HTML. 2. The external news provider includes that article in its response to the Skill's broad AI-related qu ...[truncated 821 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
docs/user_guide.md:429
Finding

Unpinned Global Dependency Installation, Including Root-Level Installation

Content
View full analysis
Remediation
View remediation

other

Note
Location
scripts/publish.py:341
Finding

Developer Branding Is Hardcoded into User Publication Output

Content
View full analysis
心识孤独的猎手

AI 行业前沿资讯 · 每日更新

``` ### Technical Analysis The publisher sets a fixed developer identity as the article author and includes fixed branding in the bundled publication template. These values are not derived from the user's WeChat account configuration and cannot be disabled through the supplied default configuration. This does not alter the Agent's session goals or safety constraints, so it is not classified as Skill Instruction Hijacking. It is an output-integrity and transparency issue: normal use can cause a user to publish third-party attribution or promotional branding under the user's own official account. ### Attack Path 1. The user configures the Skill for the user's WeChat account. 2. The normal publication flow creates a draft. 3. The draft payload automatically identifies the developer as the author. 4. If the bundled template is used, the generated article also displays the developer-associated brand. 5. The user may publish the draft without noticing or intending the attribution. ### Impact Assessment The issue does not grant filesystem, operating-system, or WeChat API privileges to an attacker. Its scope is publication integrity and user reputation. Potential consequences include: - Unintende ...[truncated 161 chars]
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (32)

Tainted flow: 'params' from os.environ.get (line 147, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/publish.py (reported line 160)May include surrounding context.

python
for i in range(1, retry_count + 1):
            try:
                self.logger.info(f"获取 Token(尝试 {i}/{retry_count})")
                response = requests.get(token_url, params=params, timeout=30)
                response.raise_for_status()
                result = response.json()

Tainted flow: 'params' from os.environ.get (line 147, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/publish.py (reported line 357)May include surrounding context.

python
for i in range(1, retry_count + 1):
            try:
                self.logger.info(f"创建草稿(尝试 {i}/{retry_count})")
                response = requests.post(
                    draft_url,
                    params=params,
                    json=data,

Chaining Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The documented chain curl -fsSL ... | sudo -E bash combines remote content retrieval, shell interpretation, and privileged execution in a single step. This is a classic high-risk pattern because any compromise of the fetched content or delivery path results in immediate root-level arbitrary code execution.

Content

Scanner excerpt · docs/user_guide.md (reported line 86)May include surrounding context.

bash
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

# 3. 安装 OpenClaw

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README includes what appears to be a real WeChat app_secret in plaintext within setup commands, which is a direct secret exposure. If the credential is valid, attackers could abuse the associated application or account APIs; even if it is a sample, normalizing this practice strongly encourages insecure secret handling by users.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Publishing a plaintext app_secret in the configuration table duplicates the secret exposure and reinforces insecure credential management in user-facing instructions. Because this skill automates access to a public account, compromise of such credentials can enable unauthorized publishing or broader API misuse.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
83% confidence
Finding

The use of sudo -E specifically preserves the caller's environment while launching a privileged shell for remotely fetched code. That combination can expose sensitive variables and makes the privileged execution context less predictable and therefore more dangerous.

Content

Scanner excerpt · docs/user_guide.md (reported line 86)May include surrounding context.

bash
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

# 3. 安装 OpenClaw

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
83% confidence
Finding

The use of sudo -E specifically preserves the caller's environment while launching a privileged shell for remotely fetched code. That combination can expose sensitive variables and makes the privileged execution context less predictable and therefore more dangerous.

Content

Scanner excerpt · docs/user_guide.md (reported line 86)May include surrounding context.

bash
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

# 3. 安装 OpenClaw

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · docs/user_guide.md (reported line 87)May include surrounding context.

md
# 1. 打开终端
# 2. 安装 Node.js(如未安装)
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

# 3. 安装 OpenClaw
sudo npm install -g openclaw

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

The guide tells users to install a global npm package with sudo, which grants the package's install scripts root privileges. If the package or a dependency is malicious or compromised, this can lead to full system compromise.

Content

Scanner excerpt · docs/user_guide.md (reported line 90)May include surrounding context.

md
sudo apt-get install -y nodejs

# 3. 安装 OpenClaw
sudo npm install -g openclaw

# 4. 验证安装
openclaw --version

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The guide explicitly instructs users to pass the WeChat AppSecret on the command line and store it in a plaintext JSON config file, while also showing it in examples. Command-line secrets can be exposed via shell history, process listings, logs, and screenshots, and plaintext storage increases the chance of credential theft and account compromise.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
76% confidence
Finding

Recommending sudo npm install -g openclaw as a troubleshooting step normalizes running package installation scripts as root. This increases the blast radius of any malicious or compromised dependency and can turn a supply-chain issue into full host compromise.

Content

Scanner excerpt · docs/user_guide.md (reported line 436)May include surrounding context.

npm install -g openclaw

解决方案 2:使用 sudo(macOS/Linux)

sudo npm install -g openclaw

text

**Q2: openclaw 命令找不到?**

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · docs/user_guide.md (reported line 452)May include surrounding context.

bash
# 检查配置文件权限
# macOS/Linux:
chmod 600 ~/.agents/skills/wechat-publisher/config/config.json

# Windows: 以管理员身份运行配置命令

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill advertises automatic collection and scheduled publishing to a public WeChat account without clearly warning that it will autonomously publish externally visible content. In this context, lack of disclosure increases the risk of unintended public posting, reputational harm, and privacy/compliance issues if users enable automation without understanding the consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README instructs users to pass a WeChat app_secret directly on the command line and does not warn about shell history, terminal logging, screenshots, or CI logs. This creates a realistic credential exposure path, especially because the example uses a secret-like value and encourages unsafe handling of production credentials.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s natural-language description and generated user-facing content are explicitly fixed to Chinese, and the report format later hardcodes Chinese headings and labels. There is no indication that the user can opt into another language or that the locale restriction is intentionally justified as region-specific.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/news_collector.py (reported line 48)May include surrounding context.

python
# 备用方案:使用固定 API
        self.api_sources = [
            "https://newsapi.org/v2/top-headlines?category=technology&apiKey=",
            "https://api.currentsapi.services/v1/latest-news"
        ]
    
    def collect_news(self, count=15):

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The fallback path fabricates hard-coded headlines and attributes them to real organizations like OpenAI, Google, TechCrunch, and The Verge, then saves and reports them as if they were genuine collected news. This creates an integrity and misinformation risk: downstream users or agents may act on false information believing it came from trusted sources.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language description and user-facing strings are entirely Chinese and specifically target WeChat official account publishing, but there is no indication that the user can choose another language or that the locale restriction is an explicit opt-in. Under the policy, forcing a specific language/locale without user choice should be flagged unless the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code accesses a sensitive credential (WECHAT_APP_SECRET) and can also load the secret from configuration, but it provides no explicit safety warning in comments/docstrings about handling secrets or privacy implications. The existing log messages only report success/failure and do not warn users that credentials are being consumed by the skill.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/publish.py (reported line 146)May include surrounding context.

python
# 获取新 Token
        app_secret = self._get_app_secret()
        token_url = "https://api.weixin.qq.com/cgi-bin/token"
        params = {
            "grant_type": "client_credential",
            "appid": self.config["app_id"],

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/publish.py (reported line 334)May include surrounding context.

python
# 获取新 Token
        app_secret = self._get_app_secret()
        token_url = "https://api.weixin.qq.com/cgi-bin/token"
        params = {
            "grant_type": "client_credential",
            "appid": self.config["app_id"],

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This request sends app credentials to the WeChat token endpoint, and later requests publish generated article content to WeChat. Although the script logs operational status, it does not clearly disclose to users that credentials and publication content are transmitted to external services.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/publish.py (reported line 357)May include surrounding context.

python
for i in range(1, retry_count + 1):
            try:
                self.logger.info(f"创建草稿(尝试 {i}/{retry_count})")
                response = requests.post(
                    draft_url,
                    params=params,
                    json=data,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The publishing flow uploads generated article content to WeChat and also writes publication artifacts locally without any explicit consent prompt, minimization, or sensitivity checks. In an agent skill context, this is more dangerous because users may not realize that externally sourced or model-generated content, along with identifiers like DraftID, is being transmitted and persisted automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly requires a WeChat public-account AppID and AppSecret and states it will automatically publish content to a remote draft box, but the description does not clearly warn users about the sensitivity of these credentials or the fact that the skill will perform authenticated remote actions on their account. This creates informed-consent and credential-handling risk: users may provide powerful secrets without understanding exposure, storage, or misuse implications.

Content

No source excerpt is available for this finding.