Back to skill

Security audit

wechat-mp-draft-publisher

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent WeChat draft-publishing purpose, but it installs and runs unverified remote executables and exposes access tokens in ways users should review carefully.

Install only if you trust the exact CLI binary source and can tolerate WeChat and possibly GitHub credential exposure in logs or process metadata. Prefer a manually installed, pinned, checksum-verified CLI, avoid direct URL auto-download, unset GITHUB_TOKEN before use, and do not share command output because it may include the WeChat access token.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/install_mp_weixin_skill.sh:112
Finding

Unverified Remote Executable Is Automatically Downloaded and Executed

Content
View full analysis
/dev/null 2>&1; then if file "$tmp_file" | grep -qi 'zip archive'; then is_zip=1 fi fi if [ "$is_zip" -eq 1 ]; then if ! command -v unzip >/dev/null 2>&1; then echo "unzip is required to extract zip asset" >&2 exit 1 fi extract_dir="$(mktemp -d)" unzip -o "$tmp_file" -d "$extract_dir" >/dev/null candidate="$extract_dir/mp-weixin-skill" if [ ! -f "$candidate" ]; then candidate="$(find "$extract_dir" -type f -name 'mp-weixin-skill*' | head -n1 || true)" fi if [ -z "${candidate:-}" ] || [ ! -f "$candidate" ]; then echo "cannot find mp-weixin-skill in zip asset" >&2 rm -rf "$extract_dir" exit 1 fi chmod +x "$candidate" mv "$candidate" "$OUT" rm -rf "$extract_dir" "$tmp_file" else chmod +x "$tmp_file" mv "$tmp_file" "$OUT" fi ``` The publishing wrapper subsequently installs and invokes the downloaded executable: ```bash ensure_bin() { if [ -x "$BIN" ]; then return fi if [ -z "$GITHUB_REPO" ] && [ -z "$RELEASE_URL" ]; then err_json "executable not found: $BIN ; set --bin or configure --url/MP_WECHAT_RELEASE_URL or --repo/MP_WECHAT_GITHUB_REPO" exit 1 fi local installer="$SCRIPT_DIR/install_mp_weixin_skill.sh" if [ ! -x "$installer" ]; then err_json "inst ...[truncated 2966 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/install_mp_weixin_skill.sh:112
Finding

GitHub Bearer Token Is Sent to Arbitrary Direct-Download Hosts

Content
View full analysis
`. 5. The attacker’s server records the header. 6. The attacker reuses the token against GitHub APIs within the permissions and lifetime granted to it. ### Impact Assessment The attacker can obtain the complete GitHub bearer token. Resulting access depends on its scopes and repository permiss ...[truncated 302 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/publish_draft.sh:181
Finding

WeChat Access Token Is Exposed in Standard Output, Process Arguments, and Error Messages

Content
View full analysis
&1)"; then err_json "command failed: $BIN $* ; $output" exit 1 fi local last_line last_line="$(printf '%s\n' "$output" | awk 'NF{p=$0} END{print p}')" if [ -z "$last_line" ]; then printf '{}\n' return fi printf '%s\n' "$last_line" } ``` The access token is passed to child processes as a command-line argument: ```bash AUTH_JSON="$(run_cli getAuth)" ACCESS_TOKEN="$(extract_json_field "$AUTH_JSON" "access_token")" if [ -z "$ACCESS_TOKEN" ]; then err_json "getAuth succeeded but access_token not found in: $AUTH_JSON" exit 1 fi # 2) uploadArticleImage (optional) ARTICLE_URL="" if [ -n "$ARTICLE_IMAGE" ]; then ARTICLE_JSON="$(run_cli uploadArticleImage --token "$ACCESS_TOKEN" --path "$ARTICLE_IMAGE")" ARTICLE_URL="$(extract_json_field "$ARTICLE_JSON" "url")" fi # 3) uploadCoverImage COVER_JSON="$(run_cli uploadCoverImage --token "$ACCESS_TOKEN" --path "$COVER_IMAGE")" ``` It is also supplied to `addDraft` and deliberately returned in standard output: ```bash DRAFT_JSON="$(run_cli addDraft \ --token "$ACCESS_TOKEN" \ --title "$TITLE" \ --author "$AUTHOR" \ --content-file "$CONTENT_FILE" \ --digest "$DIGEST" \ --thumb-media-id "$THUMB_MEDIA_ID")" printf '{"access_token":"%s","article_image_url":"%s","cover_upload":%s,"thumb_media_id_used":"%s","draft":%s}\n' \ "$(escape_json "$ACCESS_TOKEN")" \ "$(escape_json "$ARTICLE_URL")" \ "$COVER_JSON" \ "$(escape_json "$THUMB_MEDIA_ID")" \ "$DRAFT_JSON" ``` ### Technical Analysis The wrapper exposes the WeChat access token through three channels: 1. It passes the token through `--token "$ACCESS_TOKEN"`, potentially making it vi ...[truncated 1618 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a WeChat draft publisher, but its documented behavior includes downloading and executing binaries from arbitrary direct URLs or GitHub releases and performing local installation steps. That mismatch is dangerous because users may consent to publishing content, not to supply-chain style code retrieval and execution on their machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The auto-download mode permits fetching an executable from a direct release URL or repository release and then running it, without any warning about integrity verification or trust. This is a classic remote code execution and supply-chain risk, especially because the URL can be user-controlled or point to a compromised release asset.

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 41)May include surrounding context.

md
bash scripts/publish_draft.sh \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/publish_draft.sh \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/publish_draft.sh \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/publish_draft.sh \

External Script Fetching

High
Category
Supply Chain
Confidence
91% confidence
Finding

The script fetches release metadata and later downloads an executable asset from a remote source, ultimately installing code obtained over the network without integrity or publisher verification. In the context of a skill installer, this is dangerous because compromise of the repository, release asset, redirect target, or user-supplied repo/url can lead to arbitrary code execution on the host.

Content

Scanner excerpt · scripts/install_mp_weixin_skill.sh (reported line 87)May include surrounding context.

sh
fi

  if [ -n "${GITHUB_TOKEN:-}" ]; then
    release_json="$(curl -fsSL -H "Authorization: Bearer ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" "$api_url")"
  else
    release_json="$(curl -fsSL -H "Accept: application/vnd.github+json" "$api_url")"
  fi

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The final JSON intentionally includes the WeChat access token, which can expose bearer credentials to calling agents, logs, shell history capture, CI output, or downstream tools that consume stdout. Anyone obtaining that token may be able to perform authenticated API actions against the WeChat account until the token expires.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill explicitly instructs use of a shell script and an executable that can download, install, chmod, unzip, and run binaries, but it declares no tool scope or permission boundary. That omission makes the skill harder to sandbox and review, increasing the chance that an agent executes shell actions beyond what a user expects.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
---
name: wechat-mp-draft-publisher
description: Publish WeChat Official Account draft articles through a packaged CLI executable that wraps WeChat API calls. Use when the user wants to publish or create a draft from local article content and images, especially when the required flow is getAuth -> uploadArticleImage -> uploadCoverImage -> addDraft.
---

# WeChat MP Draft Publisher

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill asks for article content, images, and local credentials, and indicates use of WeChat and optionally GitHub, but it does not clearly warn that these materials and secrets will be transmitted to external services. This creates a data exposure risk because users may provide sensitive unpublished content or API credentials without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill supports automatically downloading and installing an executable from a direct URL or GitHub release and then using it in the publishing flow, but the contract does not mention any integrity verification, publisher trust validation, or pinning requirements. In a skill that processes credentials and publishes content, executing externally fetched code creates a clear supply-chain risk that could lead to credential theft, arbitrary code execution, or unauthorized publication.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The installer explicitly accepts an arbitrary --url and then downloads and installs whatever executable or zip is provided. That creates a direct arbitrary-code-install path unrelated to the narrow skill purpose, and there is no signature, checksum, allowlist, or publisher verification to ensure the binary is trusted.

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/install_mp_weixin_skill.sh (reported line 81)May include surrounding context.

sh
asset_url="$URL"
if [ -z "$asset_url" ]; then
  if [ "$TAG" = "latest" ]; then
    api_url="https://api.github.com/repos/${REPO}/releases/latest"
  else
    api_url="https://api.github.com/repos/${REPO}/releases/tags/${TAG}"
  fi

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/install_mp_weixin_skill.sh (reported line 83)May include surrounding context.

sh
asset_url="$URL"
if [ -z "$asset_url" ]; then
  if [ "$TAG" = "latest" ]; then
    api_url="https://api.github.com/repos/${REPO}/releases/latest"
  else
    api_url="https://api.github.com/repos/${REPO}/releases/tags/${TAG}"
  fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script silently downloads an executable, may extract a zip, marks the result executable, and moves it into place with minimal user warning or confirmation. This increases the chance of users installing untrusted code without understanding that network retrieval and executable deployment are occurring.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script will fetch a replacement executable from a user-controlled GitHub repo, release asset, or direct URL and then execute it with the user's WeChat credentials and local file inputs. This is a classic remote code execution / supply-chain risk, made worse because no integrity verification, signature check, pinned source, or trust prompt is required before execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script automatically downloads and executes a CLI binary when the expected executable is absent, without any warning, confirmation, or provenance disclosure to the user. In an agent skill context, this creates stealthy execution of newly retrieved code and compounds the supply-chain risk because users may not realize network retrieval and code execution occurred.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The contract requires a plaintext credential file in the user's home directory but provides no guidance on file permissions, storage hygiene, or avoiding accidental disclosure. While this documentation alone does not exfiltrate secrets, it normalizes insecure secret handling and increases the chance that app credentials are left broadly readable, committed, or exposed through logs and support workflows.

Content

No source excerpt is available for this finding.