Back to skill

Security audit

wechat-public-cli

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for WeChat/Baijiahao publishing, but it asks users to install mutable third-party CLI code and use sensitive account credentials for high-impact publishing actions without enough safeguards.

Review the upstream package and repository before installing, prefer a pinned local version over global npm or unpinned npx, and keep WeChat/Baijiahao credentials out of source control with restricted file permissions. Treat publish and send-all commands as account-impacting actions that should be reviewed explicitly before execution.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
skill.md:14
Finding
Unpinned Third-Party Code Installation and Execution## Vulnerability Details **File Location**: `skill.md:14-24` and `skill.md:38-55` **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium The Skill instructs users to install and execute third-party code without pinning a package version or repository commit: ```yaml "install": [ { "id": "npm", "kind": "shell", "label": "Install wechat-public-cli (npm)", "command": "npm install -g wechat-public-cli", }, { "id": "git", "kind": "shell", "label": "Clone repo and install dependencies", "command": "git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git && cd obsidian-wechat-public-platform && npm install", }, ], ``` The documentation also provides mutable installation and execution commands: ```bash git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git cd obsidian-wechat-public-platform npm install npm install -g wechat-public-cli npx wechat-public-cli wechat:draft --file /path/to/article.md ``` ### Technical Analysis The npm commands do not specify an audited package version, and the Git command clones the repository's mutable default branch rather than a verified commit or signed release. Consequently, the code retrieved when these instructions are followed may differ from the code that existed when the Skill was audited. Both `npm install` and `npx` can execute package lifecycle scripts or package binaries. In particular, `npx` may retrieve and immediately execute the currently resolved package release. The global installation command also installs executable code outside the project-local dependency boundary. No malicious code was identified in the supplied project files. The risk arises from trusting mutable external package and repository sources without ve ...[truncated 1474 chars]
Remediation
## Remediation Suggestions 1. Pin the npm package to a specific reviewed version instead of installing the latest mutable release: ```bash npm install --save-exact wechat-public-cli@<reviewed-version> ``` 2. Prefer a project-local installation over `npm install -g` and invoke the pinned binary through a package script. 3. Replace the mutable Git clone workflow with checkout of a reviewed full commit hash: ```bash git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git cd obsidian-wechat-public-platform git checkout --detach <reviewed-full-commit-hash> ``` 4. Verify release signatures, commit signatures, checksums, or npm package provenance before execution. 5. Commit a reviewed lockfile and use `npm ci` so transitive dependency resolution is reproducible. 6. Avoid `npx` commands that automatically download an unspecified package. Use the explicitly pinned local binary instead. 7. Review dependency lifecycle scripts before installation and, where operationally compatible, install with scripts disabled before explicitly running only trusted build steps. 8. Run the CLI with least privilege in an isolated environment and expose only the credentials and files required for the selected operation. 9. Restrict platform credentials to the minimum required permissions and rotate them immediately if dependency compromise is suspected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

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.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
The documentation instructs users to run `npx wechat-public-cli ...` without pinning a version. This can expose users to supply-chain risk because `npx` fetches the latest package by default, so a compromised or typosquatted package release could execute attacker-controlled code on the local machine.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill documents storing highly sensitive credentials and cookies in a local JSON config file and environment variables without any warning about secure handling. This increases the risk of secret leakage through source control, shell history, shared machines, logs, or overly permissive file permissions, potentially enabling account takeover or unauthorized publishing.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill exposes a mass-broadcast command that sends content to all WeChat followers but does not warn about the consequences, approval requirements, or irreversibility. In an agent-assisted workflow, lack of friction or warning increases the chance of accidental bulk publication, reputational harm, spam complaints, or policy violations.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
This CSS file contains natural-language comments exclusively in Chinese, including the file header and usage notes. Under the language/locale policy, forcing a specific language without offering choice or documenting a justified region-specific constraint can be a policy violation.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
Several comments and sections are presented in Chinese within an otherwise English document, such as command annotations and later headings, without indicating a user-selectable language or locale preference. This can violate language/locale policy expectations when a specific language is imposed without opt-in.

Static analysis

No suspicious patterns detected.