Back to skill

Security audit

claude-wechat-bridge-with-files

Security checks for vulnerabilities and agentic risk

Overview

This skill is transparent about bridging Claude/OpenClaw to WeChat, but it gives an agent broad real-world messaging and local credential authority with weak safeguards.

Review this carefully before installing. Use a dedicated WeChat account, pin the npm package version, avoid long-running unattended use, and do not enable proactive sending unless you accept that local credentials can be used to send messages without a fresh inbound user prompt. Treat any received files as untrusted and avoid sending secrets through the bridge.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (5)

T08 · Insecure Dependencies

Error
Location
SKILL.md:35
Finding

Unpinned Third-Party MCP Package Is Loaded Outside the Channel Allowlist

Content
View full analysis
claude --dangerously-load-development-channels server:wechat ``` ### Technical Analysis The documented configuration executes `claude-wechat-channel` through `npx` without specifying an exact package version. Depending on the local npm cache and `npx` behavior, a future package release may be downloaded and executed even though that release was not reviewed with this Skill. The package is then enabled using `--dangerously-load-development-channels`, which deliberately loads a third-party channel that is not in Claude Code's normal channel allowlist. The bridge necessarily requires some form of channel integration, but combining an unpinned package with an explicit allowlist bypass exceeds the minimum safe configuration needed for that integration. Although `SKILL.md` later recommends pinning version `0.1.2`, the primary installation example remains unpinned and is likely to be copied directly by users. ### Attack Path 1. The npm package account, publication process, or an upstream dependency is compromised. 2. An attacker publishes a malicious future version of `claude-wechat-channel`. 3. A user starts the configured MCP server with `npx`. 4. `npx` retrieves or selects the malicious version because no exact version is specified. 5. The user launches Claude Code with `--dangerously-load-development-channels`. 6. The malicious package executes with the privileges of the local user and participates in a channel that handles WeChat messages and Agent notifications. ### Impact Assessment A compromised package could execute arbitrary code with the invoking user's OS permissions. It could potentially access files re ...[truncated 408 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
wsend.js:30
Finding

Bearer Credential and Message Content Can Be Sent to an Unvalidated Endpoint

Content
View full analysis
f.endsWith(".json")); for (const f of files) { try { const a = JSON.parse(fs.readFileSync(path.join(ACCT_DIR, f), "utf-8")); if (a.token && a.baseUrl) return a; // {token, baseUrl, userId, accountId} } catch {} } die("没找到可用的账号凭证(需含 token + baseUrl)"); } ``` ```js const url = (baseUrl.endsWith("/") ? baseUrl : baseUrl + "/") + "ilink/bot/sendmessage"; const res = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json", AuthorizationType: "ilink_bot_token", Authorization: `Bearer ${token.trim()}`, "X-WECHAT-UIN": randomWechatUin(), }, body, }); ``` ### Technical Analysis Proactive network transmission is necessary for the Skill's declared messaging functionality. The unsafe aspect is that the destination comes directly from the first qualifying account JSON file and is not constrained to HTTPS or a known WeChat host. The script also does not verify that the selected account file is a regular file owned by the current user, reject symbolic links, check restrictive file permissions, or require deterministic account selection. Consequently, anyone able to modify or introduce a JSON file in the account directory can control where the reusable bearer token and message body are sent. The transmitted body also includes the destination user ID and plaintext message. Therefore, endpoint manipulation exposes both authentication material and private communication content. ### Attack Path 1. An attacker or compromised local process gains write access to `~/.wechat-claude/accounts/`. 2. The attacker inserts or modifies a `.json` file con ...[truncated 1127 chars]
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Warning
Location
apply-media-patch.sh:13
Finding

Patch Script Broadly Replaces Executable Code in All Matching npx Cache Installations

Content
View full analysis
&2 exit 1 fi TARGETS=() while IFS= read -r line; do TARGETS+=("$line") done < <(find "$HOME/.npm/_npx" -type f -path "*/claude-wechat-channel/dist/monitor.js" 2>/dev/null) if [[ ${#TARGETS[@]} -eq 0 ]]; then echo "no claude-wechat-channel install found under ~/.npm/_npx/" >&2 echo "run \`npx claude-wechat-channel\` once first so npm fetches it" >&2 exit 1 fi for target in "${TARGETS[@]}"; do case "$target" in *.orig) continue ;; esac if [[ ! -f "${target}.orig" ]]; then cp "$target" "${target}.orig" fi if grep -q "media patch active" "$target" 2>/dev/null; then echo "already patched: $target" continue fi cp "$PATCH_SRC" "$target" echo "patched: $target" done ``` ### Technical Analysis The script searches the entire `~/.npm/_npx` hierarchy and replaces every matching `claude-wechat-channel/dist/monitor.js`. It does not select one known installation, verify the package version, validate the original file hash, validate the patch hash, or confirm that the target is compatible with the replacement. The patch changes executable code that later runs under the trusted package name. This is tool replacement: callers believe they are executing the installed npm package, but a central component has been substituted with Skill-provided code. The source-file existence check does not establish integrity. If `patched-monitor.js` is modified before the script runs, the modified payload is propagated into every matching installation. The breadth of the search also exceeds the minimum privilege needed to patch one explicitly selected and reviewed package inst ...[truncated 1377 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
patched-monitor.js:81
Finding

Inbound Media Downloads Lack Explicit Resource and Retention Limits

Content
View full analysis
it.type === MessageItemType.VOICE && it.voice_item?.text); const markers = []; for (const item of itemList) { const t = item.type; if (t !== MessageItemType.IMAGE && t !== MessageItemType.FILE && t !== MessageItemType.VIDEO && t !== MessageItemType.VOICE) { continue; } if (t === MessageItemType.VOICE && hasVoiceTranscript) { continue; } try { const r = await downloadMediaFromItem(item, { cdnBaseUrl, tmpDir: mediaTmpDir, label: `inbound-${fromUserId}`, }); if (r.decryptedPicPath) markers.push(`[图片: ${r.decryptedPicPath}]`); if (r.decryptedFilePath) markers.push(`[文件: ${r.decryptedFilePath}]`); if (r.decryptedVoicePath) markers.push(`[语音文件: ${r.decryptedVoicePath}]`); if (r.decryptedVideoPath) markers.push(`[视频: ${r.decryptedVideoPath}]`); } catch (err) { logger.error(`media download failed for ${fromUserId}: ${String(err)}`); } } ``` ### Technical Analysis The monitor downloads every supported media item in an inbound message. At this call site there is no limit on: - Number of attachments per message. - Individual download size. - Aggregate size per message, sender, or time window. - Download duration. - Concurrent or cumulative storage consumption. - Retention duration for downloaded files. The imported `downloadMediaFromItem` implementation was not included in the audited project, so any protections it may provide could not be verified. The Skill's own code should enforce limits rather than depend implicitly on an unreviewed third-party helper. Files are placed in a persistent media directory, and no cleanup or quota mechanism appears i ...[truncated 959 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
patched-monitor.js:112
Finding

Sensitive Inbound Message Content and Sender Identifiers Are Written to Logs

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (19)

Ssd 3

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The media patch causes inbound attachments to be downloaded to absolute local paths and then injected into the model-visible message stream for direct reading. This broadens untrusted input handling from text to arbitrary files and exposes local filesystem locations, increasing the risk of prompt injection through document contents, malicious file processing chains, privacy leakage, and unintended access patterns by the agent.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
`.orig`、覆盖为 `patched-monitor.js`。已打过补丁的会跳过。npm 重新安装/升级包之后再跑一次即可。

Ssd 4

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill provides step-by-step instructions to defeat the wrapper's inbound-message safeguard and send unsolicited messages via a lower-level API. In context, this is more dangerous because the bridge already connects an AI system to a real-world messaging channel; removing the reply-only constraint increases the risk of unauthorized outreach, spam, harassment, and deceptive AI-driven contact.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
ls ~/.npm/_npx/*/node_modules/claude-wechat-channel/data/ 2>/dev/null

# 强制重新登录(用新二维码)
rm -rf ~/.npm/_npx/*/node_modules/claude-wechat-channel/data/
# 重启 claude --dangerously-load-development-channels server:wechat

# 验证主动发送(给自己发一条测试)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
ls ~/.npm/_npx/*/node_modules/claude-wechat-channel/data/ 2>/dev/null

# 强制重新登录(用新二维码)
rm -rf ~/.npm/_npx/*/node_modules/claude-wechat-channel/data/
# 重启 claude --dangerously-load-development-channels server:wechat

# 验证主动发送(给自己发一条测试)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly promotes bypassing the normal reply-only constraint by sending WeChat messages without prior user interaction, but it does not include any warning, consent requirement, rate limiting guidance, or privacy considerations. In a messaging bridge skill, this increases the risk of unsolicited outreach, accidental disclosure of sensitive task results to the wrong recipient, and abuse of stored account credentials for outbound messaging.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill explicitly configures and operates a network-capable MCP/channel bridge but declares no tool scope or permission boundary. In a skill that forwards user messages, downloads media, and invokes external services, the absence of explicit allowed-tools/permissions increases the chance that an agent will use broader capabilities than intended without clear operator consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description and trigger phrases are entirely specified in Chinese, and the file does not indicate that other languages are supported or that Chinese is an opt-in requirement. Under the policy for natural-language issues, forcing a specific language or locale without user choice is a violation unless clearly justified.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

Using npx claude-wechat-channel without a pinned version creates a supply-chain risk: future publishes or account compromise could cause a different package version to be fetched and executed automatically. Because this package is run as an MCP bridge with access to messages, credentials, and local files, a malicious update could exfiltrate sensitive data or execute arbitrary code in the user's environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill documents a deliberate bypass of the package's reply-only safeguard by calling the underlying send API directly through wsend.js, enabling unsolicited outbound messaging. This materially expands capability from responding within an established conversation to initiating messages to arbitrary userId targets, which can be abused for spam, phishing, social engineering, or covert notifications.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code automatically downloads inbound image, file, video, and voice attachments to a local temporary directory and then exposes their filesystem paths back into the message flow. In a bridge skill that connects an external messaging platform to an agent, this creates a real privacy and trust-boundary issue: untrusted remote users can cause files to be persisted locally without explicit consent, retention controls, size/type validation, or clear user notice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code forwards inbound message text plus sender identifiers over the MCP notification channel to Claude Code, which is a direct exfiltration of user content across a system boundary. In the context of a WeChat-to-agent bridge, this is core functionality, but it is still security-relevant because it transmits potentially sensitive conversations and metadata without any consent gate, minimization, or visible warning in this component.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script is explicitly designed to bypass the normal 'must receive an inbound message first' restriction and enable proactive outbound messaging. In the context of a messaging bridge, that weakens an expected safety/control boundary and can be abused for unsolicited messaging, spam, or sending model-generated content to a user without an active session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script automatically loads bearer-token account credentials from ~/.wechat-claude/accounts and immediately uses them to send outbound requests, with no confirmation prompt, scope check, or interactive warning. In a bridge skill whose purpose is to connect Claude/OpenClaw to WeChat, this increases the risk of silent credential use and unintended message sending if the script is invoked by another tool or with attacker-controlled input.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code sends message content and a bearer token to acct.baseUrl without enforcing HTTPS, certificate pinning, or even validating that the configured baseUrl uses a secure scheme. If baseUrl is set to plain HTTP or a malicious endpoint, message contents and authentication credentials can be intercepted or exfiltrated, enabling account abuse and unauthorized messaging.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Earlier installation instructions say the binding credentials are automatically stored in ~/.npm/_npx/<hash>/, while the wsend.js section says credentials are read from ~/.wechat-claude/accounts/*.json. These statements actively describe different actual credential locations, so at least one of them does not match the implementation being documented. This can mislead users about where sensitive auth material resides and what the tool actually depends on.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The appended markers use Chinese labels such as 图片, 文件, 语音文件, and 视频, which imposes a specific language in generated content. The file does not offer language selection or indicate that the skill is intentionally limited to a Chinese-language context.

Content

No source excerpt is available for this finding.