Back to skill

Security audit

Mp Publisher

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it handles WeChat and image-generation credentials with enough weak safeguards that users should review it before installing.

Install only after reviewing the setup script and credential handling. Use least-privilege WeChat credentials with IP allowlisting, set .env files to owner-only permissions, avoid setting DMX_BASE_URL unless you trust the endpoint, remove token-prefix logging, pin dependencies, and manually review drafts before any real 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/setup.sh:17
Finding

Unpinned Third-Party Packages Installed During Setup

Content
View full analysis
/dev/null || pip install -q requests wechatpy 2>/dev/null || true ``` ### Technical Analysis The setup script installs the latest available versions of `requests` and `wechatpy` from the invoking environment's configured Python package index. It does not constrain package versions, verify package hashes, use a lock file, or isolate installation in a virtual environment. The `wechatpy` dependency is also not used by the supplied source code, meaning its installation unnecessarily increases the supply-chain attack surface. Redirecting standard error and ending the command chain with `|| true` can conceal installation failures or suspicious resolver behavior. Package installation can execute package build and installation logic with the privileges of the user running the setup script. If the configured package index, dependency account, DNS path, or a future package release is compromised, attacker-controlled installation code could run locally. ### Attack Path 1. An attacker compromises a package release, dependency account, package mirror, or pip index configuration used by the target. 2. The user runs `scripts/setup.sh`. 3. The unpinned `pip install` command resolves and downloads the attacker-controlled package version. 4. Package build or installation logic executes with the setup user's privileges. 5. The attacker can access or modify resources available to that user, including OpenClaw workspaces and credential files. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the privileges of the account running setup. The resulting access may include modification of OpenClaw scripts, theft of WeChat or DMX credentials accessible to that user, alteration of generated content, ...[truncated 210 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup.sh:23
Finding

Credential Files Created Without Explicit Restrictive Permissions

Content
View full analysis
~/.openclaw/workspace-mp-editor/.env << 'EOF' # WeChat public-account configuration WECHAT_APP_ID=your_app_id_here WECHAT_APP_SECRET=your_app_secret_here EOF echo " Created ~/.openclaw/workspace-mp-editor/.env (configuration required)" else echo " ~/.openclaw/workspace-mp-editor/.env already exists" fi # Image API configuration if [ ! -f ~/.openclaw/workspace-designer/.env ]; then cat > ~/.openclaw/workspace-designer/.env << 'EOF' # DMX API configuration DMX_API_KEY=your_api_key_here EOF ``` The comments and messages above are translated for reporting clarity; the executable statements and credential variable names are unchanged. ### Technical Analysis The setup script creates two `.env` files intended to contain live API credentials, but it does not establish a restrictive umask or apply explicit file permissions. The resulting access mode depends on the caller's existing umask. With a permissive umask, these files may be readable by other local users or processes operating under other accounts. The script also does not harden an already existing `.env` file, so a previously created file with unsafe permissions remains exposed. These credential paths are necessary for the declared WeChat draft and DMX image-generation functionality. The issue is not access to the paths itself, but the absence of least-privilege protection around the secrets stored there. ### Attack Path 1. A user runs setup while operating under a permissive umask, or an existing `.env` file already has permissive access modes. 2. The user replaces the placeholders with a real WeChat AppSecret and DMX API key. 3. Another local user or compromised process enumerates the kno ...[truncated 887 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
lib/draft_publisher.py:271
Finding

WeChat Access-Token Prefix Disclosed in Test Output

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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (35)

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

Critical
Category
Data Flow
Confidence
92% confidence
Finding

The request destination is derived from the DMX_BASE_URL environment variable without validation, so a user or calling environment can redirect requests and the Bearer API key to an arbitrary host. In this script, that means prompt contents and credentials may be exfiltrated via SSRF-style outbound requests or hostile endpoint substitution.

Content

Scanner excerpt · lib/image_generator.py (reported line 78)May include surrounding context.

python
try:
        print(f"[INFO] 正在生成图片: {prompt[:50]}...")
        
        response = requests.post(
            api_url,
            headers=headers,
            json=data,

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 23)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 24)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 29)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 31)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 35)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 36)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 40)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 42)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 64)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 71)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 81)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 82)May include surrounding context.

sh
echo "[2/4] 创建配置文件模板..."

# 微信公众号配置
if [ ! -f ~/.openclaw/workspace-mp-editor/.env ]; then
    cat > ~/.openclaw/workspace-mp-editor/.env << 'EOF'
# 微信公众号配置
WECHAT_APP_ID=your_app_id_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 65)May include surrounding context.

sh
# 检查微信配置
if grep -q "your_app_id_here" ~/.openclaw/workspace-mp-editor/.env 2>/dev/null; then
    echo "     ⚠️  微信公众号配置未完成,请编辑 ~/.openclaw/workspace-mp-editor/.env"
else
    echo "     ✅ 微信公众号配置已完成"
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/setup.sh (reported line 72)May include surrounding context.

sh
# 检查微信配置
if grep -q "your_app_id_here" ~/.openclaw/workspace-mp-editor/.env 2>/dev/null; then
    echo "     ⚠️  微信公众号配置未完成,请编辑 ~/.openclaw/workspace-mp-editor/.env"
else
    echo "     ✅ 微信公众号配置已完成"
fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill requires sensitive公众号 credentials and sends content to external services including WeChat and DMX API, yet the README does not clearly warn about credential handling, third-party data exposure, or the consequences of sending article content and metadata off-platform. This omission increases the chance that operators will over-share sensitive drafts or mis-handle secrets in an automation pipeline with publishing-side effects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README presents a natural-language trigger phrase ("今天写三篇") that is broad and conversational, without defining strict invocation boundaries or required confirmation state. In an agentic environment, this can cause unintended workflow execution from ordinary chat, leading to accidental drafting activity, external API usage, and actions against connected publishing infrastructure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The short trigger phrase "今天写X篇" is ambiguous and may be used in ordinary conversation without the user intending to start an automated publishing pipeline. In this skill, activation can cascade into topic generation, drafting, image generation, and draft publication preparation, so an imprecise trigger increases the chance of unintended workflow execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger condition "用户要求生成选题、写文章、发布公众号" is broad enough to match common editorial requests and can invoke a multi-step workflow that performs external actions, including creating WeChat draft content. Because this skill connects to configured credentials and downstream agents, accidental activation could cause unintended content generation or publication-side effects rather than remaining a passive assistive response.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level documentation says '发布到公众号草稿箱' and the filename suggests publishing, which implies a publish action, but the implemented API endpoint is the draft creation endpoint and the status marker written back is '已入草稿箱'. This is an intent-level documentation mismatch that could mislead users about whether content is actually published or only staged as a draft.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This Python code reads sensitive credentials from environment variables and sends them to the WeChat API to obtain an access token. While the module docstring lists the required variables, it does not warn the user that the script will transmit those credentials to an external third-party endpoint.

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 · lib/draft_publisher.py (reported line 31)May include surrounding context.

python
APP_ID = os.environ.get("WECHAT_APP_ID", "")
APP_SECRET = os.environ.get("WECHAT_APP_SECRET", "")

ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token"
UPLOAD_IMAGE_URL = "https://api.weixin.qq.com/cgi-bin/material/add_material"
CREATE_DRAFT_URL = "https://api.weixin.qq.com/cgi-bin/draft/add"

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 · lib/draft_publisher.py (reported line 32)May include surrounding context.

python
APP_ID = os.environ.get("WECHAT_APP_ID", "")
APP_SECRET = os.environ.get("WECHAT_APP_SECRET", "")

ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token"
UPLOAD_IMAGE_URL = "https://api.weixin.qq.com/cgi-bin/material/add_material"
CREATE_DRAFT_URL = "https://api.weixin.qq.com/cgi-bin/draft/add"

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 · lib/draft_publisher.py (reported line 33)May include surrounding context.

python
APP_ID = os.environ.get("WECHAT_APP_ID", "")
APP_SECRET = os.environ.get("WECHAT_APP_SECRET", "")

ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token"
UPLOAD_IMAGE_URL = "https://api.weixin.qq.com/cgi-bin/material/add_material"
CREATE_DRAFT_URL = "https://api.weixin.qq.com/cgi-bin/draft/add"

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 · lib/draft_publisher.py (reported line 87)May include surrounding context.

python
data = {"articles": articles}
        
        response = requests.post(url, json=data, timeout=60)
        result = response.json()
        
        if "media_id" in result: