Back to skill

Security audit

Wjs Publishing Wechat

Security checks for vulnerabilities and agentic risk

Overview

The skill’s WeChat publishing goal is coherent, but it asks users to run an unpinned third-party image wrapper with persistent Codex auth and sends unpublished article content to external services with weak consent and scoping.

Install only if you are comfortable with unpublished article text, titles, and generated assets being sent to external AI and WeChat services. Pin and inspect the gpt-image-2-skill dependency before running it, avoid sensitive drafts unless redacted, and manually confirm before image generation or draft upload.

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
SKILL.md:95
Finding

Mutable third-party executable is installed and run with access to Codex authentication and unpublished content

Content
View full analysis
&1) || { ``` `gen-illustration.sh:33-56` places the complete article into the instructions and sends it through the same executable: ```bash # Build instructions: read template + slot in article body INSTRUCTIONS=$(python3 -c " import sys template = open(sys.argv[1]).read() article = open(sys.argv[2]).read() print(template.replace('[文章内容]', article)) " "$TEMPLATE" "$ARTICLE_MD") GEN_PROMPT="根据 instructions 中的文章内容,生成一张扁平卡通风格的解释图。画幅比例由内容决定 (双行对照用 3:2 / 4:3, 单行流程用横长条, 层级深度用竖版), 选最易读的版本。把文章的核心层级 / 对比 / 递进结构可视化,让读者一眼看懂。中文标签必须准确无伪字。" OUT="${ARTICLE_DIR}/illustration.png" SIZE="${WECHAT_PUBLISH_IMAGE_SIZE:-1536x1024}" QUALITY="${WECHAT_PUBLISH_IMAGE_QUALITY:-high}" echo "calling gpt-image-2-skill (illustration, size: $SIZE, quality: $QUALITY)" >&2 cd "$HOME/.claude/skills/gpt-image-2-skill" # Codex-only: --instructions is supported solely by the codex provider, and we # do not allow OPENAI_API_KEY fallback. ~/.codex/auth.json must exist. RESULT=$(node "$W ...[truncated 2823 chars]
Remediation
View remediation
``` 2. Publish and verify a SHA-256 digest or cryptographic signature for the exact installed files before execution. 3. Prefer vendoring the minimal reviewed wrapper into this project so the audited package contains its complete executable behavior. 4. Review the wrapper and its transitive Node.js dependencies for credential handling, network destinations, subprocess execution, and arbitrary filesystem access. 5. Run image generation in a sandbox with access only to: - The necessary input prompt. - A dedicated output directory. - A short-lived provider token rather than persistent account credentials. 6. Remove unrelated environment variables before launching the wrapper and restrict outbound network access to documented provider endpoints. 7. Explicitly disclose that the full article is supplied to an external AI workflow, and obtain user confirmation before transmitting confidential or unpublished material. 8. Avoid recommending a moving repository head as an executable installation mechanism. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
publish.sh:59
Finding

Article path is interpolated into AppleScript source without escaping

Content
View full analysis
` or invokes it while located in that directory. 4. The script resolves the crafted path and assigns it to `$HTML`. 5. The unquoted heredoc substitutes that value directly into the ...[truncated 1085 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
upload-draft.sh:89
Finding

Article content and image attributes are inserted into draft HTML without escaping or sanitization

Content
View full analysis
{alt}

') elif block.startswith('# '): # Drop body H1 — the WeChat editor uses meta.json title as the article title. # Keeping a body H1 causes md2wechat inspect's DUPLICATE_H1 warning. continue else: blocks.append(f'

{block}

') content_html = '\n'.join(blocks) open('content.html', 'w').write(content_html) ``` ### Technical Analysis The converter places three article-controlled values directly into generated HTML: - Ordinary Markdown blocks are inserted into an HTML element body without escaping. - Markdown image alternative text is inserted into the `alt` attribute without attribute escaping. - Markdown image source values are inserted into the `src` attribute without escaping or URL-scheme validation. An attacker-controlled block can therefore close the generated paragraph and add arbitrary markup. Likewise, quotation marks in image alt text or source values can terminate their attributes and introduce new attributes or elements. The generated HTML is embedded in `draft.json` and uploaded through `md2wechat create_draft`. The script relies implicitly on downstream WeChat sanitization, but it neither verifies what markup WeChat accepts nor applies a local allowlist. Security should not depend solely on undocumented or changeable downstream filtering. This issue is particularly relevant when article text co ...[truncated 1695 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (21)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README describes AI-generated covers and illustrations and references external image-generation dependencies, but it does not clearly warn users that article content, prompts, or derived metadata may be transmitted to third-party services. This can lead to unintentional disclosure of drafts, unpublished content, or sensitive information during normal use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README says the skill auto-fires on broad phrases like “润色” and “准备发布,” which are common requests and could invoke the skill unexpectedly outside a narrow WeChat-publishing context. Because the skill can generate assets, prepare article folders, and use external tooling, accidental activation increases the chance of unintended data handling or side effects.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.md (reported line 56)May include surrounding context.

cp -r /tmp/g/skills/gpt-image-2-skill ~/.claude/skills/

text

Auth: either `OPENAI_API_KEY` (needs OpenAI org verification for `gpt-image-2`) **or** Codex `~/.codex/auth.json` (any ChatGPT Plus account works, no verification needed — recommended).

- **Optional**: `pandoc` for nicer markdown→html. The fallback is a built-in minimal converter.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill clearly instructs file creation, file modification, environment-dependent behavior, and execution of local scripts, yet it declares no explicit tool scope or permission boundaries. Without a declared allowlist, an agent may invoke broader filesystem or environment capabilities than users expect, increasing the chance of unauthorized reads/writes or unsafe tool use during activation.

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: wjs-publishing-wechat
description: Use when the user wants to write or publish a 微信公众号 (WeChat Official Account) article — they share rough thoughts, a draft, or notes and ask for help polishing, generating a cover image (题图) and explanation illustration (解释图), or preparing the article for upload to mp.weixin.qq.com. Triggers include "写一篇微信文章", "公众号", "润色", "题图", "发公众号", "/wjs-publishing-wechat".
---

# wjs-publishing-wechat

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list includes broad phrases like '公众号', '润色', and '题图', which can match many ordinary writing requests beyond this skill's intended scope. Over-broad activation increases the chance that the skill runs in contexts where the user did not intend local file creation, image generation, or draft-upload preparation, causing unexpected side effects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The firing conditions are ambiguous and include generic writing scenarios like providing a draft or asking for polishing, plus directory-based activation. This makes accidental activation more likely, especially in mixed workspaces, and can lead to unintended modifications or network-backed operations under the wrong task context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs automatic AI image generation and explicitly says the illustration flow reads the full article and sends it to an external model, but it provides no user-facing consent or warning. This can leak unpublished drafts, sensitive notes, or proprietary content to third-party services without the user's informed approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill automatically creates local article packages and later uploads content into the user's WeChat draft backend, but it does not require an explicit confirmation immediately before these state-changing actions. Because these operations modify local files and push content to a remote account, accidental activation or misunderstood intent could result in unwanted persistence or publication-preparation in a live environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill states that edits are automatically synchronized to a public GitHub repository via an external hook, which is unrelated to the user-facing publishing task and can expose skill contents or modifications outside the local environment. This creates a hidden data egress path and a supply-chain risk because changes may be committed and pushed without a security review at the time of editing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Line L001 hard-codes a WeChat public account cover format and frames it as a non-overridable highest-priority constraint. This effectively forces a specific locale/platform context without user opt-in, which matches the language/locale policy-violation category for natural-language instructions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Lines L292-L358 repeatedly instruct the system to automatically choose among square, vertical, ultrawide, and banner aspect ratios based on the word's meaning. This directly conflicts with the explicit hard constraint in L001 and the final execution note in L551 that the image is for a WeChat cover and must remain 2.35:1 horizontal.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends article-derived content to an external image-generation service by passing both the title-derived word and a templated instruction set to a remote provider, but it does not clearly warn the operator that content from the article folder may leave the local machine. In a publishing workflow, article titles and prompts can contain embargoed, sensitive, or identifying information, so silent transmission creates a real confidentiality and privacy risk even if the transfer is functionally intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language prompt says "中文标签必须准确无伪字," which enforces Chinese labeling regardless of user preference. This is a locale/language constraint in natural language, and the file does not provide opt-in, alternatives, or justification for why Chinese is mandatory.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends the full contents of article.md to an external image-generation wrapper as --instructions with no explicit consent, redaction step, or clear disclosure that article text may leave the local environment. Because this skill is used for drafting/publishing articles, the article may contain unpublished content, sensitive business material, or personal data, so silent transmission creates a real confidentiality and privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Line L19 explicitly requires '中文短标签', and the overall instructions throughout the file are Chinese-only. This imposes a specific language on the skill output without giving the user a locale or language choice, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is explicitly targeted at 微信公众号 and all interactive prompts shown to the user are in Chinese, with no option to select another language or locale. This is a natural-language policy concern because the skill imposes a specific language on users without documenting opt-in or offering alternatives.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This JSON file is a manifest-like test prompt file, so vague-trigger checks apply. The prompts at L05, L11, and L17 are ordinary conversational requests without any explicit trigger constraints, negative examples, or scope boundaries, which could normalize activation on broad everyday phrasing rather than a narrowly defined invocation condition.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content in the prompts and expected behavior prescribes Chinese-specific output conventions, including Chinese punctuation and publication formatting, but does not indicate that the user is offered a language or locale choice. This can violate language/locale policy when the skill behavior is treated as mandatory rather than user-selected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The README frames the skill specifically around writing and publishing 微信公众号 articles and uses Chinese trigger phrases, but does not explicitly state that this is an intentional locale-specific constraint or offer alternatives for other languages/locales. Under the policy, forcing a specific language or locale without opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code creates or overwrites content.html and draft.json in the target article folder. While the script header explains the pipeline, it does not explicitly warn the user at runtime that local files will be written, which is a user-impacting operation for a code file under this rule.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.