Back to skill

Security audit

微信公众号监控

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its WeChat monitoring purpose, but it needs review because it handles credentials, scheduled monitoring, and local files with weak scoping.

Review before installing. Use an environment variable or secret manager for MPTEXT_API_KEY, do not edit the script with a real key, only run it with simple product names you control, and avoid enabling any scheduled monitoring until the scheduler, destination, transmitted data, and removal steps are explicit.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
monitor.py:256
Finding

Path Traversal Through an Unvalidated Product Name

Content
View full analysis
1 else "default" # 获取天数参数(默认7天) days = 7 if len(sys.argv) > 2 and sys.argv[2] == "--days": if len(sys.argv) > 3: days = int(sys.argv[3]) # 检查产品目录是否存在 product_dir = os.path.join(BASE_DIR, product_name) if not os.path.exists(product_dir): print(f"❌ 产品 '{product_name}' 的目录不存在") print(f"请先告诉我要添加该产品的公众号") sys.exit(1) # 加载账号 accounts = load_accounts(product_name) if not accounts: print(f"❌ 产品 '{product_name}' 没有配置任何公众号") sys.exit(1) print(f"🔍 检查 {product_name} 的 {len(accounts)} 个公众号(近{days}天)...\n") # 检查更新 results = check_updates(accounts, days=days) if results and results[0].get('code') == 'AUTH_FAILED': print(results[0]['error']) sys.exit(1) # 生成报告 report = generate_report(product_name, results) # 保存报告 report_file = save_report(product_name, report) # 删除首次运行flag(如果存在) flag_file = os.path.join(product_dir, "first_run.flag") if os.path.exists(flag_file): os.remove(flag_file) ``` The same unvalidated value reaches the account-reading and report-writing operations: ```python def load_accounts(product_name): """加载指定产品的账号配置""" accounts_file = os.path.join(BASE_DIR, product_name, "accounts.json") ``` ```python def save_report(product_name, report): """保存报告到文件""" reports_dir = os.path.join(BASE_DIR, product_name, "reports") os.makedirs(reports_dir, exist_ok=True) today = datetime.now().strftime("%Y-%m-%d") report_file = os.path.join(reports_dir, f"{t ...[truncated 2558 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
README.md:38
Finding

Documentation Encourages Storage of an API Key in Source Code

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documented purpose understates important behavior: third-party API access using credentials, local persistence, and only local report generation despite claiming report push. Description-behavior mismatches are dangerous because users may authorize the skill under false assumptions and may not realize credentials or data are being sent to an external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README advertises automatic daily monitoring, report pushing, and scheduled task setup, but it does not clearly warn users that installing or using the skill may create persistent automation that continues making network requests and transmitting data after initial setup. In an agent-skill context, this matters because users may not realize the skill changes system behavior over time or causes recurring external communication, which increases operational and privacy risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README explicitly offers editing source code to embed an API key, which normalizes hardcoded credentials and increases the chance the secret will be leaked through source control, backups, logs, screenshots, or shared files. In a reusable skill intended to be copied into user workspaces, this is especially risky because users may treat the modified script as ordinary project code and accidentally publish it.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill clearly instructs reading environment variables, creating and writing files, and making outbound network requests, but it declares no explicit tool scope or permission boundaries. That mismatch increases the chance the agent can invoke capabilities more broadly than users expect, especially since it also handles API credentials and persistent workspace state.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger phrase for the research stage is broad and lacks exclusion conditions, making accidental or contextually inappropriate invocation more likely. In an agent environment, over-broad activation can cause unintended network lookups, file creation, or workflow execution without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

This duplicate finding points to the same session-persistence behavior: the workflow stores flags and account configuration in the workspace so later runs behave differently. That persistence can surprise users and create lingering state if the skill is reused for multiple products or by different operators in the same environment.

Content

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

收到我确认后,才执行:

bash
mkdir -p wechat-monitor/{产品名}/reports
# 创建accounts.json
# 创建首次运行flag(首次推送将查询近7天)
touch ~/.openclaw/workspace/wechat-monitor/{产品名}/first_run.flag

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

This duplicate finding points to the same session-persistence behavior: the workflow stores flags and account configuration in the workspace so later runs behave differently. That persistence can surprise users and create lingering state if the skill is reused for multiple products or by different operators in the same environment.

Content

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

收到我确认后,才执行:

bash
mkdir -p wechat-monitor/{产品名}/reports
# 创建accounts.json
# 创建首次运行flag(首次推送将查询近7天)
touch ~/.openclaw/workspace/wechat-monitor/{产品名}/first_run.flag

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The monitoring-stage trigger includes the very generic phrase '执行监控', which can be matched in many unrelated contexts. Because this stage leads to external API access and report generation, ambiguous triggering raises the risk of unintended execution and unnecessary data processing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill says results will be 'pushed' to the user but does not define allowed destinations, data sensitivity, or privacy boundaries. Any outbound delivery mechanism without clear scope can result in unintended disclosure of monitored content, account lists, or generated analysis to unauthorized channels.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation recommends hardcoding the API key directly into the script as an acceptable configuration path, without warning about credential exposure. Embedding secrets in code greatly increases the risk of accidental leakage through version control, logs, backups, or workspace sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code removes first_run.flag as a side effect after execution. Although it prints a message after deletion, there is no warning beforehand or confirmation step for this destructive file operation, and the deletion changes future script behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script creates a reports directory and writes a dated .md report file, but there is no confirmation prompt or prior user-facing disclosure that running the script will persist generated content under the product directory. Because this is a file-writing operation affecting user data layout, it should be disclosed explicitly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The JSON sample data uses Chinese-only account names and category labels such as "官方", "竞品", and "行业媒体". Because SQP-3 applies to all file types and flags language/locale policy violations when a skill forces a specific language without user opt-in, this hardcoded locale-specific content may violate organizational language-choice requirements if used as part of the skill behavior.

Content

No source excerpt is available for this finding.