Back to skill

Security audit

WeCom post in group

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with scheduled WeChat Work webhook posting, but it exposes reusable webhook secrets and sends live messages without strong confirmation guardrails.

Install only if you are comfortable with the agent creating recurring active posts to a WeChat Work group. Treat the webhook URL/key like a password: avoid putting it in shell history, logs, or prompts, rotate it if exposed, and require a clear confirmation before any test or scheduled message is sent.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:34
Finding
Webhook Bearer Credential Exposed Through Process Arguments, Output, and Automation Prompts<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:34-38` - `SKILL.md:104-119` - `scripts/validate_webhook.py:117-119` **Vulnerability Type**: Plaintext sensitive-data exposure **Risk Level**: Medium **Classification**: T09: Insecure Skill Coding Practices ### Vulnerable Code `SKILL.md:34-38` instructs users to pass the webhook credential as a command-line argument: ```markdown To validate the webhook, run the validation script: ```bash python3 {SKILL_DIR}/scripts/validate_webhook.py <webhook_url_or_key> ``` ``` `SKILL.md:104-119` places the full webhook URL, including its bearer key, directly into persistent automation configuration and prompt text: ```markdown mode: "suggested create" name: <descriptive name based on content and schedule> prompt: <date guard if needed> + <content generation steps> + <push via webhook> rrule: <computed RRULE from Step 2> cwds: <current workspace> status: ACTIVE ``` **Automation prompt template:** ``` {DATE_GUARD_IF_NEEDED} 执行以下步骤: 1. {CONTENT_GENERATION_STEPS} 2. 将整理好的内容通过企业微信群机器人 Webhook 推送,Webhook 地址为:{WEBHOOK_URL} ``` `scripts/validate_webhook.py:117-119` prints the complete webhook URL after validation: ```python if result.get("errcode") == 0: print(f"✅ Webhook is valid! Response: {json.dumps(result)}") # Output the full URL for downstream use print(f"\nWEBHOOK_URL={url}") ``` ### Technical Analysis A WeChat Work webhook key functions as a bearer credential: possession of the complete URL is sufficient to submit messages to the associated group webhook. The project exposes that credential through three channels: 1. Passing the URL or key as a command-line argument can expose it through shell history, process inspection, audit telemetry, terminal recording, and command-execution logs. 2. Printing `WEBHOOK_URL={url}` discloses the complete credential to standard output, where it may be retained in CI logs, agent transcripts, job logs, or monitoring systems. 3. Embedding the complete ...[truncated 1988 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Remove secrets from command-line arguments** - Accept webhook credentials through protected standard input, an environment variable supplied by a secret manager, or a credential-file descriptor. - Avoid documenting commands that place the key directly in shell history. - If a credential file is supported, require restrictive permissions and reject files accessible to other users where feasible. 2. **Never print the complete webhook URL** - Remove `print(f"\nWEBHOOK_URL={url}")`. - Return only a success indicator or a masked identifier such as the first eight and last four key characters. - Apply centralized redaction to errors, debug output, and structured logs. 3. **Use secret references in automation configuration** - Store the webhook URL in an approved encrypted secret store. - Put only a secret identifier in the automation prompt, such as `WECHAT_WEBHOOK_SECRET_ID`. - Resolve the secret only at execution time and prevent its value from being included in prompts, tool output, task exports, or logs. 4. **Reduce exposure and rotate affected credentials** - Rotate webhook keys that have already appeared in logs, command histories, transcripts, or automation prompts. - Remove historical plaintext values from retained logs and task configurations where possible. - Restrict access to automation definitions and execution logs according to least privilege. 5. **Add automated secret-leakage tests** - Test that successful validation output never contains the supplied key. - Test automation serialization and logging paths to ensure credentials are redacted. - Add a repository rule preventing full webhook URLs or bearer keys from being included in examples, logs, or persisted prompt templates. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description emphasizes scheduled/recurring webhook pushes with flexible recurrence rules, which is the core promised capability. The supplied code only validates a WeChat Work webhook, reads message content, and POSTs it immediately as text or markdown. While it does push to WeChat Work webhooks as described, it lacks any mechanism for time-based triggering, cron-like scheduling, persistence, recurrence rule parsing, or advanced patterns such as 'last Monday of each month.' Therefore the implementation materially underdelivers the declared primary purpose, making the description inaccurate.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description centers on setting up scheduled or recurring webhook pushes to WeChat Work groups, including multiple recurrence modes. The supplied code does not implement any scheduling, recurrence logic, content scheduling setup, or job management. Instead, it accepts a webhook URL or key, validates format, sends a test POST request to the WeChat Work webhook, and reports success/failure. While it does interact with WeChat Work webhooks, that is only tangentially related; its primary behavior is webhook validation, which is materially different from the declared scheduling/push automation purpose.

Chaining Abuse

High
Category
Tool Misuse
Content
| 周四 / 星期四 | Thursday | TH |
| 周五 / 星期五 | Friday | FR |
| 周六 / 星期六 | Saturday | SA |
| 周日 / 星期日 | Sunday | SU |

---
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill instructs the agent to read files containing webhook secrets and make outbound network requests, but it declares no explicit tool scope or allowed-tools boundary. That increases the chance of unintended file access or external transmission beyond what a user expects, especially when handling secrets like webhook URLs/keys.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The workflow directs a live test push to a user-supplied webhook before automation creation, but it does not require explicit confirmation that data will be sent to an external endpoint. This can leak sensitive or unintended content to third-party destinations and can also be abused if a malicious webhook URL is supplied.

External Transmission

Medium
Category
Data Exfiltration
Content
--message "<FORMATTED_CONTENT>"
```

Or use curl directly:

```bash
curl -s '<WEBHOOK_URL>' \
Confidence
95% confidence
Finding
The skill explicitly performs external transmission of content to a webhook, which is security-relevant because webhook URLs are secrets and the payload may include sensitive user data. In this skill context, outbound delivery is expected, but it is still dangerous without guardrails because the destination is user-controlled and the examples encourage direct curl-based sending.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The provided automation prompt template is written entirely in Chinese and directs the generated workflow in that language, without indicating that language should follow user preference. This can violate language/locale policy when the user has not opted into Chinese or requested Chinese output.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The section explicitly says to always generate a human-readable description for the user, and all provided user-facing examples are in Chinese. Because the file does not state that the skill is China/Chinese-locale specific or offer an opt-in language choice, this creates a natural-language locale policy concern.

Intent-Code Divergence

Medium
Confidence
91% confidence
Finding
The docstring and usage text describe the script as validating a webhook, but success is defined by sending a test message successfully. That mismatch is security-relevant because operators or downstream automation may invoke it assuming it is side-effect free, when it actually performs an action on an external system and can generate unintended outbound communications.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The script's 'validation' logic performs a real POST to the supplied WeChat Work webhook, which causes an actual message to be delivered to the target group. In this skill context, users may expect harmless format validation, but the behavior can trigger unintended notifications, leak operational testing activity, or be abused to send messages to arbitrary approved webhooks supplied by a caller.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script sends a live message to the provided webhook immediately, without requiring explicit user confirmation or presenting a safety notice at the point of transmission. In a scheduling/webhook skill, this increases the chance of accidental posts into production chat groups and makes the tool easier to misuse as a message-sending primitive under the guise of validation.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The natural-language string sent by the script is fixed in Chinese, which imposes a specific language choice on users and recipients. The file does not offer a language option or explain that the skill is intentionally limited to a Chinese locale or region-specific workflow.

Static analysis

No suspicious patterns detected.