Back to skill

Security audit

Baoyu Post To Wechat

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it claims, but it gives article content and images broad access to local files, private network URLs, third-party rendering, and plaintext WeChat credentials without enough safeguards.

Install only if you trust the publisher and will use it on trusted article files. Avoid processing untrusted Markdown/HTML, do not include sensitive PlantUML diagrams, do not allow articles to reference internal URLs or arbitrary local paths, prefer environment variables or a secret manager for WeChat credentials, and run it in a restricted workspace/profile when possible.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/vendor/baoyu-md/src/extensions/plantuml.ts:122
Finding

PlantUML source is automatically disclosed to a public rendering service

Content
View full analysis
, ): string { const encoded = encodePlantUML(code) const formatPath = options.format === `svg` ? `svg` : `png` return `${options.serverUrl}/${formatPath}/${encoded}` } ``` ```ts async function fetchSvgContent(svgUrl: string): Promise { try { const response = await fetch(svgUrl) if (!response.ok) { throw new Error(`HTTP ${response.status}`) } const svgContent = await response.text() return svgContent .replace(/(]*)\swidth="[^"]*"/g, `$1`) .replace(/(]*)\sheight="[^"]*"/g, `$1`) .replace(/(]*style="[^"]*?)width:[^;]*;?/g, `$1`) .replace(/(]*style="[^"]*?)height:[^;]*;?/g, `$1`) } catch (error) { console.warn(`Failed to fetch SVG content from ${svgUrl}:`, error) return `
PlantUML diagram loading failed
` } } ``` ```ts export function markedPlantUML( options: PlantUMLOptions = {}, ): MarkedExtension { const resolvedOptions: Required = { serverUrl: options.serverUrl || `http ...[truncated 2106 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wechat-api.ts:77
Finding

Unrestricted remote image retrieval enables SSRF and forwarding of internal responses

Content
View full analysis
{ let fileBuffer: Buffer; let filename: string; let contentType: string; if (imagePath.startsWith("http://") || imagePath.startsWith("https://")) { const response = await fetch(imagePath); if (!response.ok) { throw new Error(`Failed to download image: ${imagePath}`); } const buffer = await response.arrayBuffer(); if (buffer.byteLength === 0) { throw new Error(`Remote image is empty: ${imagePath}`); } fileBuffer = Buffer.from(buffer); const urlPath = imagePath.split("?")[0]; filename = path.basename(urlPath) || "image.jpg"; contentType = response.headers.get("content-type") || "image/jpeg"; } // ... const body = Buffer.concat([headerBuffer, fileBuffer, footerBuffer]); const url = `${UPLOAD_URL}?access_token=${accessToken}&type=image`; const res = await fetch(url, { method: "POST", headers: { "Content-Type": `multipart/form-data; boundary=${boundary}`, }, body, }); ``` ```ts const localPathMatch = fullTag.match( /data-local-path=["']([^"']+)["']/, ); const imagePath = localPathMatch ? localPathMatch[1]! : src; console.error(`[wechat-api] Uploading image: ${imagePath}`); try { let resp = uploadedBySource.get(imagePath); if (!resp) { resp = await uploadImage(imagePath, accessToken, baseDir); uploadedBySource.set(imagePath, resp); } // ... } ``` ```ts export async function downloadFile( url: string, destPath: string, ): Promise { return await new Promise((resolve, reject) => { const protocol = url.startsWith("https://") ? https : http; ...[truncated 3248 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wechat-api.ts:77
Finding

Article-controlled image paths permit arbitrary local-file reads and attempted uploads

Content
View full analysis
= { ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".png": "image/png", ".gif": "image/gif", ".webp": "image/webp", }; contentType = mimeTypes[ext] || "image/jpeg"; } ``` ### Technical Analysis The publishing workflow trusts local image paths extracted from article HTML. A `data-local-path` attribute takes precedence over the visible `src` value. Absolute paths are accepted directly, while relative paths are resolved without verifying that the canonical result remains inside the article directory. Consequently, an article can use an absolute path or `../` traversal to select any ...[truncated 1791 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:18
Finding

Unpinned runtime retrieval and mutable dependencies create a supply-chain execution risk

Content
View full analysis
.ts`. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun. ``` ```json { "dependencies": { "fflate": "^0.8.2", "front-matter": "^4.0.2", "highlight.js": "^11.11.1", "juice": "^11.0.1", "marked": "^15.0.6", "reading-time": "^1.5.0", "remark-cjk-friendly": "^1.1.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.5" } } ``` ### Technical Analysis When Bun is unavailable, the Skill instructs the Agent to execute `npx -y bun`. This can retrieve and execute a package from the npm registry without an interactive review step. No exact runtime version or artifact digest is specified. The vendored Markdown package also declares dependencies with caret ranges. The supplied project tree does not contain a lockfile, so later installation can resolve versions different from those reviewed during this audit. This does not establish that any current dependency is malicious. The vulnerability is that executable third-party content can change after review and execute with the same privileges as the Agent. ### Attack Path 1. The target environment does not have a local `bun` executable. 2. The Skill detects `npx` and invokes `npx -y bun`. 3. npm resolves and downloads a remotely hosted package without prompting the user. 4. A compromised package version, maintainer account, registry response, or transitive dependency supplies hostile code. 5. Package or runtime code executes with the privileges of the Agent. 6. The hostile code can access project files, environment variables, ...[truncated 777 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:121
Finding

WeChat application secrets may be stored in plaintext without permission or repository safeguards

Content
View full analysis
WECHAT_APP_SECRET= ``` ```md accounts: - name: [display name] alias: [short key, e.g. "baoyu"] default: true default_publish_method: [api/browser] default_author: [author name] need_open_comment: [1/0] only_fans_can_comment: [1/0] app_id: [WeChat App ID, optional] app_secret: [WeChat App Secret, optional] ``` ```ts export function loadCredentials( account?: ResolvedAccount, ): { appId: string; appSecret: string } { if (account?.app_id && account?.app_secret) { return { appId: account.app_id, appSecret: account.app_secret, }; } const cwdEnvPath = path.join( process.cwd(), ".baoyu-skills", ".env", ); const homeEnvPath = path.join( os.homedir(), ".baoyu-skills", ".env", ); const cwdEnv = loadEnvFile(cwdEnvPath); const homeEnv = loadEnvFile(homeEnvPath); // ... appSecret = process.env[`${prefix}APP_SECRET`] || cwdEnv[`${prefix}APP_SECRET`] || homeEnv[`${prefix}APP_SECRET`] || ""; ``` ### Technical Analysis The Skill explicitly supports storing WeChat AppSecrets in project-level `.env` files and directly inside `EXTEND.md`. These are ordinary plaintext files. The setup in ...[truncated 1849 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (122)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description centers on publishing WeChat Official Account content, but the supplied code chunk only implements local clipboard operations. It accepts either an image path or HTML input/file and places that content onto the OS clipboard using Swift/AppKit on macOS, wl-copy/xclip on Linux, and PowerShell/.NET clipboard APIs on Windows. There is no evidence of WeChat-specific logic, no network/API calls, no browser automation or Chrome CDP usage, no markdown handling, no citation conversion, and no posting workflow. This is a materially different primary purpose and capability set from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents the skill as an end-to-end WeChat publishing tool. This code chunk, however, is a Markdown conversion utility only. It reads a Markdown file from disk, derives metadata, renders HTML with optional theming/color and default citation behavior, resolves embedded images, and outputs paths/metadata as JSON. That citation behavior does align with part of the description, but the core advertised capability—posting content to a WeChat Official Account via API or browser automation—is absent. Since the primary purpose in the description is publication, while the actual code only prepares content for publication, this is a material description/behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code does not implement WeChat Official Account posting, article/image-text creation, markdown conversion, or any API/CDP workflow for publishing公众号 content. Its sole purpose is generic desktop automation: sending a paste keystroke to the active application, optionally activating a target app first on macOS. That is a materially different primary purpose and an undeclared capability unrelated to the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about publishing WeChat Official Account content. The actual code chunk is not a WeChat posting implementation; it is a unit/integration test file for generic Chrome CDP utilities. While Chrome CDP is mentioned in the description as one possible transport, this code only tests browser-debugging support functions and contains no logic for article creation, markdown/plain-text conversion, image-text posting, WeChat API calls, authentication, or publication workflows. Therefore the supplied code chunk does not accurately represent the declared skill purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk’s primary purpose is browser automation infrastructure, not posting to WeChat Official Accounts. While the declared description mentions API or Chrome CDP support for公众号 publishing, the actual code shown only provides low-level CDP/browser discovery and launch helpers. There is no implementation of WeChat login, navigation to WeChat, article creation, markdown/plain-text/HTML conversion, citation generation, media handling, or submission/posting actions. The behavior is therefore materially broader/different than the declared user-facing purpose, exposing undeclared generic browser-control capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This code chunk’s primary purpose is command-line option parsing for a markdown-to-styled-output renderer, likely a vendor helper used before publishing. While some options such as --cite and markdown-related formatting are loosely consistent with preparing WeChat-friendly content, the declared purpose centers on actually posting content to WeChat Official Accounts. The supplied code contains no network access, browser automation, WeChat endpoints, media upload, article creation, or publishing logic. Therefore the behavior shown is materially different from the declared skill purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk is clearly a unit/integration test module (document.test.ts) for markdown rendering/document metadata helpers. Its operations are confined to assertions, temporary directory creation, reading/writing a local EXTEND.md settings file, and verifying option resolution. The declared description centers on publishing content to WeChat Official Accounts, including posting workflows and markdown link-to-citation handling. None of those core capabilities appear in this code. Because the actual primary purpose of the supplied chunk is testing markdown configuration/document helpers rather than publishing to WeChat, this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose centers on publishing content to WeChat Official Accounts. The supplied code is a markdown-to-HTML rendering/document-generation utility. It loads theme/config settings, renders markdown, builds HTML/CSS, inlines styles, extracts title/author/description metadata, and optionally saves output as a local HTML file with backup rotation. While markdown conversion could be a supporting component of a WeChat publishing pipeline, this chunk by itself does not implement the declared primary capability of posting to WeChat, nor does it interact with network APIs, browser automation, or image-text publishing. Because the actual behavior is a local document rendering/export module rather than a publisher, this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk is unrelated to publishing to WeChat Official Accounts. It contains only Markdown extension logic for detecting alert syntax in blockquotes or ::: containers and rendering styled HTML alert blocks with icons/titles. There are no network requests, WeChat APIs, Chrome CDP interactions, article/image posting flows, authentication steps, or link-to-citation conversion behavior shown here. Therefore the supplied code does not accurately represent the declared skill purpose and is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description focuses on publishing content to WeChat Official Accounts, including transport mechanisms and content-posting workflows. The actual code chunk does not implement any of those behaviors. It simply exports markdown extension modules from a vendor package. While markdown processing could be a supporting component in a larger posting pipeline, this specific code chunk has a materially different direct purpose and lacks the declared posting capabilities, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk is unrelated to posting content to a WeChat Official Account. It does not call any WeChat API, use Chrome CDP for publishing, handle article/image-text submission, process markdown for WeChat formatting, or manage links/citations. Its primary purpose is frontend rendering of infographic blocks inside markdown using @antv/infographic and replacing a placeholder div with generated SVG. That is a materially different behavior from the declared publishing functionality, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk does not implement posting to WeChat Official Accounts, image-text publishing, API/CDP interaction, article submission, authentication, or link-to-citation conversion. Its primary purpose is completely different: extending a Markdown parser to detect KaTeX/LaTeX-style math syntax and render it as SVG using MathJax. That is not a mere supporting detail of WeChat publishing; it is an unrelated content-rendering component. Therefore the supplied code does not accurately represent the declared skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk is a local Markdown rendering helper, not a WeChat publishing implementation. It adds custom inline syntax tokens and HTML rendering for highlight/underline/wavyline formatting. There is no evidence of network access, WeChat Official Account APIs, Chrome CDP automation, content posting, image handling, or link-to-citation conversion. The actual behavior is materially different from the declared purpose, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk does not perform WeChat Official Account posting, article publishing, image-text posting, Chrome CDP automation, or API calls to WeChat. Its primary purpose is unrelated: rendering PlantUML diagrams inside markdown/HTML output. While the comment mentions微信公众号 as a possible environment for inline SVG, that is only contextual and not evidence of posting functionality. Therefore the supplied code behavior materially differs from the declared skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about publishing content to WeChat Official Accounts. However, this code chunk contains only a markdown extension for ruby pronunciation annotations. It tokenizes custom inline syntax and renders HTML ruby tags; it does not authenticate to WeChat, call any API, automate a browser, post articles, handle images, or implement WeChat-specific formatting workflows. This is a materially different primary purpose, so the description does not accurately represent the supplied code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is about a full WeChat Official Account publishing skill. However, this code chunk only defines a marked extension that parses custom <![...]> syntax and renders HTML for a horizontally scrollable image section intended to be compatible with WeChat article content. It does not post content, call any API, use Chrome CDP, manage article/image-text publishing, or perform the described markdown citation workflow. While this rendering helper may support the broader publishing use case, the actual behavior of the supplied code chunk is materially narrower and different from the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk does not implement posting to WeChat Official Account, API/CDP interaction, article publishing, image-text publishing, authentication, link citation conversion, or any publishing workflow. Its sole purpose is local Markdown processing: detecting headings and replacing [TOC] with generated HTML. That is a materially different primary purpose from the declared WeChat publishing functionality, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill publishes content to WeChat Official Accounts, including article and image-text posting through API or Chrome CDP. The actual code chunk is only a unit test file for HTML/CSS helper functions. Its behavior is limited to validating document construction and style normalization utilities. While such utilities could potentially support a publishing pipeline, this chunk itself does not implement or demonstrate any WeChat posting capability, external service access, browser automation, or content publishing workflow. Therefore the supplied code does not accurately represent the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose centers on publishing content to WeChat Official Accounts. However, this code chunk only renders a markdown file to HTML using configurable styling and citation/count options. While markdown-to-HTML conversion could be a supporting component of a WeChat article workflow, the supplied code does not itself perform any posting, browser automation, API interaction, authentication, or image-text publication. Therefore, the code's actual behavior is materially narrower and different from the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is a WeChat Official Account publishing skill. However, the provided code is only a renderer test suite that checks Markdown parsing/rendering edge cases. It does not post content, call any WeChat APIs, automate a browser, handle account publishing flows, or manage images/articles for publication. While Markdown rendering could be a supporting component of a publishing tool, this specific chunk is purely unit tests for formatting behavior and does not reflect the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code does not post to WeChat, interact with WeChat APIs, use Chrome CDP, publish articles/image-text content, or handle markdown-to-WeChat conversion workflows. Its primary purpose is unrelated frontend rendering support for code highlighting. While such functionality could be a supporting component inside a larger markdown/article pipeline, this chunk by itself exposes materially different behavior and capabilities than the declared posting skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code clearly automates the WeChat Official Account web UI through the agent-browser CLI rather than calling any WeChat API. It opens the site, waits for QR login, clicks the 图文 creation menu, uploads image files, fills title/content fields, and optionally saves a draft. The inputs are only --title, --content, and repeated --image; --content is inserted as plain text line by line. There is no parsing or rendering of HTML, no markdown handling, and no conversion of external links into citations. The requirement that at least one image be supplied means it does not match the declared support for ordinary article posting independent of image-text mode. So while it is related to WeChat posting, the declared description materially overstates and misrepresents the implemented capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The core declared purpose mostly aligns around WeChat Official Account article creation, especially for markdown/HTML/plain-text article content and markdown link citation handling. The code clearly implements article drafting in the WeChat web editor, including markdown-to-HTML conversion, metadata extraction, clipboard-based image insertion, and Chrome CDP automation. However, there are material mismatches: (1) no API-based posting is implemented anywhere in this chunk; (2) no distinct 贴图/图文 multi-image posting workflow exists—only standard article editing with inline images; and (3) the behavior stops at saving a draft rather than actually publishing/posting, despite the description saying 'Posts content'. These are substantive capability differences, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code clearly does perform WeChat Official Account posting automation through Chrome CDP, so the broad domain is correct. However, the declared description materially overstates supported capabilities. This script requires at least one image and navigates specifically to the 图文/贴图 menu, so its implemented flow is image-text posting rather than general article posting. Markdown handling is limited to extracting frontmatter title/author and collecting plain paragraph text; there is no HTML ingestion pipeline and no markdown-specific external-link-to-citation conversion. The description also mentions API support, but no API calls are present here. These are substantive behavior mismatches, not minor implementation details.

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

md
| `scripts/wechat-api.ts` | Article posting via API (文章) |

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/cdp.ts:51

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/check-permissions.ts:69

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/copy-to-clipboard.ts:59

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/paste-from-clipboard.ts:54

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/vendor/baoyu-chrome-cdp/src/index.test.ts:89

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/vendor/baoyu-chrome-cdp/src/index.ts:220

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/wechat-agent-browser.ts:28

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/wechat-api.ts:332

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/wechat-article.ts:96

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/vendor/baoyu-chrome-cdp/src/index.ts:97