Back to skill

Security audit

微信公众号发布工具

Security checks for vulnerabilities and agentic risk

Overview

This WeChat publishing skill fits its stated purpose, but it can immediately publish or delete account content and stores WeChat secrets without clear safeguards.

Install only if you are comfortable giving the agent authority over a WeChat Official Account. Use least-privilege credentials, protect config and token files with restrictive permissions or a secret manager, avoid uploading arbitrary local paths, and require explicit human approval before public publishing or deleting drafts.

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:181
Finding

Plaintext Storage of WeChat Credentials and Access Tokens

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 181–199
Vulnerability Type: Plaintext sensitive-data storage
Risk Level: Medium

The documented configuration instructs users to store a WeChat application secret and cached access token in plaintext files under the user's home directory. It does not prescribe restrictive permissions, ownership validation, encryption, or integration with a secure credential store.

markdown
## Configuration

Create a configuration file at `~/.openclaw/config/wechat-mp.json`:

```json
{
  "app_id": "your-wechat-app-id",
  "app_secret": "your-wechat-app-secret",
  "default_author": "默认作者名",
  "access_token_cache_file": "~/.openclaw/.wechat_mp_token.json"
}

Or use environment variables:

bash
export WECHAT_MP_APP_ID="your-app-id"
export WECHAT_MP_APP_SECRET="your-app-secret"
export WECHAT_MP_DEFAULT_AUTHOR="默认作者"
export WECHAT_MP_TOKEN_CACHE="~/.openclaw/.wechat_mp_token.json"
text

### Technical Analysis

The application secret is a long-lived authentication credential, while the token cache may contain an immediately usable bearer token. Plaintext storage without explicit access-control requirements can expose these values to other local users, compromised processes, backup systems, diagnostic tooling, or accidental file publication.

The environment-variable alternative does not completely mitigate the issue. Environment variables may be inherited by child processes or exposed through debugging, crash-reporting, or process-inspection mechanisms, depending on the host environment.

The artifact contains only `SKILL.md`; therefore, the implementation of token-cache creation, file permissions, atomic writes, logging, and credential handling could not be verified. The finding is specifically based on the insecure configuration procedure documented in the supplied artifact.

### Attack Path

1. A user follows the documented procedure and places
...[truncated 1428 chars]
Remediation
View remediation

Remediation Suggestions

  1. Store the WeChat application secret in an operating-system keychain, managed secret service, or equivalent protected credential store rather than in a plaintext JSON file.
  2. If file-based storage is unavoidable, create the configuration and token-cache files with mode 0600 and their parent directories with mode 0700.
  3. Validate file ownership, type, and permissions before reading credentials. Reject symbolic links, files owned by another user, and files with group or world access.
  4. Write cached tokens atomically by creating a securely permissioned temporary file in the same protected directory and then renaming it into place.
  5. Never include application secrets or access tokens in logs, exceptions, telemetry, command output, or returned tool data. Redact sensitive values consistently.
  6. Avoid broadly exported environment variables where possible. If environment variables must be supported, document inheritance and diagnostic-exposure risks and restrict their lifetime to the relevant process.
  7. Apply least privilege to the associated WeChat application, rotate credentials periodically, and document immediate credential revocation and token invalidation procedures.
  8. Add explicit secure-setup instructions and automated permission checks to the skill documentation and implementation.
  9. Include the referenced source code, package manifest, lockfile, and tests in the distributed artifact so reviewers can verify that credential handling follows the documented security controls.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The publishing description explains capability but does not clearly warn that article content is transmitted to WeChat and, when published, may become visible to followers. In autonomous or semi-autonomous use, this can cause accidental disclosure of sensitive, draft, or internal content to an external platform and potentially to the public audience of the account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The upload-media and upload-cover tools accept a local file path and send that file to WeChat's servers, but the skill text does not clearly warn operators that local files leave the host boundary. In an agent setting, this omission can lead to unintended exfiltration of sensitive local files if the agent is instructed to upload a path without informed consent or path restrictions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The delete-draft tool performs a destructive action, but the skill documentation does not warn that deletion may be irreversible or operationally harmful. In agent workflows, missing deletion warnings increase the chance of accidental content loss or sabotage through prompt-driven destructive actions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill instructs users to persist long-lived secrets and token cache data under home-directory paths without any guidance on file permissions, encryption, or least-privilege handling. In shared systems, multi-user hosts, or compromised environments, this can expose the WeChat app secret or reusable access tokens, enabling unauthorized publishing or account abuse.

Content

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

Configuration

Create a configuration file at ~/.openclaw/config/wechat-mp.json:

json
{

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The skill documentation consistently presents user-facing messages, examples, and defaults in Chinese, with no statement that users may choose another language or locale. This can be a language policy issue when a skill implicitly forces one language without opt-in or explicit regional justification in the file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.