Back to skill

Security audit

Baoyu Post To Weibo

Security checks for vulnerabilities and agentic risk

Overview

This Weibo posting skill is mostly coherent, but it needs Review because it combines browser and clipboard automation with unpinned runtime downloads, an undisclosed PlantUML data flow, and an automatic broad Chrome-kill recovery step.

Review this skill before installing. It is intended to fill Weibo posts for manual publishing, but it can control Chrome through CDP, use a saved Weibo browser session, read the Markdown and media files you provide, manipulate the system clipboard, and send paste keystrokes. Use it only on a machine/profile where that is acceptable, avoid confidential PlantUML blocks unless remote rendering is removed or pointed to a trusted server, and prefer installing a trusted Bun runtime yourself instead of relying on the npx fallback.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T08 · Insecure Dependencies

Error
Location
scripts/weibo-utils.ts:117
Finding
Unpinned Runtime Package Is Automatically Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `scripts/weibo-utils.ts:117-120`; additionally declared in `SKILL.md:22-27` **Vulnerability Type**: Supply-chain exposure through unpinned package execution **Risk Level**: High ### Complete Vulnerable Code Snippet ```ts function runBunScript(scriptPath: string, args: string[]): boolean { const result = spawnSync('npx', ['-y', 'bun', scriptPath, ...args], { stdio: 'inherit' }); return result.status === 0; } ``` The corresponding execution instruction is: ```text **Agent Execution Instructions**: 1. Determine this SKILL.md file's directory path as `{baseDir}` 2. Script path = `{baseDir}/scripts/<script-name>.ts` 3. Replace all `{baseDir}` in this document with the actual path 4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun ``` ### Technical Analysis The helper invokes `npx -y bun` without specifying an exact package version or enforcing a lockfile and integrity hash. The `-y` option suppresses confirmation, allowing `npx` to resolve, download, and execute the package automatically. Consequently, the effective executable is not completely fixed to the code that was audited. Its behavior can change according to the configured package registry, package ownership, package version resolution, local npm configuration, or a future compromised package release. This path is used by the clipboard helpers during ordinary article composition, so the exposure is not limited to an optional development command. ### Attack Path 1. A user asks the Skill to compose a Weibo article containing HTML or images. 2. The article workflow calls `copyHtmlToClipboard`, `copyImageToClipboard`, or `pasteFromClipboard`. 3. These functions call `runBunScript`. 4. `runBunScript` executes `npx -y bun` without an exact version or integrity requirement. 5. If package resolution or the configured registry has been compromised, `npx` downloads and executes atta ...[truncated 790 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require a previously installed, trusted Bun executable and fail safely if it is unavailable. 2. Remove the automatic `npx -y` fallback from runtime workflows. 3. If package-based installation is unavoidable, pin an exact reviewed version rather than resolving the latest compatible release. 4. Commit and enforce a lockfile containing package integrity metadata. 5. Use a trusted registry explicitly and validate downloaded package integrity. 6. Resolve the executable to an expected absolute path before execution. 7. Document runtime installation as a separate, user-approved prerequisite instead of downloading executable code while handling article content. 8. Consider implementing clipboard operations directly in the primary process so that routine article composition does not invoke a package manager. ]]>

other

Warning
Location
scripts/vendor/baoyu-md/src/extensions/plantuml.ts:122
Finding
PlantUML Diagram Source Is Disclosed to an External Rendering Service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/vendor/baoyu-md/src/extensions/plantuml.ts:122-145, 190-207, 239-249`; enabled by `scripts/vendor/baoyu-md/src/renderer.ts:349-353` **Vulnerability Type**: Undisclosed transmission of user-provided article content to a third party **Risk Level**: Medium ### Complete Vulnerable Code Snippets The diagram source is compressed and encoded: ```ts function encodePlantUML(plantumlCode: string): string { try { // 步骤 1 & 2: UTF-8 编码 + Deflate 压缩 const deflated = performDeflate(plantumlCode) // 步骤 3: PlantUML 专用的 base64 编码 return encode64(deflated) } catch (error) { // 如果编码失败,回退到简单方案 console.warn(`PlantUML encoding failed, using fallback:`, error) const utf8Bytes = new TextEncoder().encode(plantumlCode) const base64 = btoa(String.fromCharCode(...utf8Bytes)) return `~1${base64.replace(/\+/g, `-`).replace(/\//g, `_`).replace(/=/g, ``)}` } } function generatePlantUMLUrl(code: string, options: Required<PlantUMLOptions>): string { const encoded = encodePlantUML(code) const formatPath = options.format === `svg` ? `svg` : `png` return `${options.serverUrl}/${formatPath}/${encoded}` } ``` The resulting URL is fetched: ```ts async function fetchSvgContent(svgUrl: string): Promise<string> { try { const response = await fetch(svgUrl) if (!response.ok) { throw new Error(`HTTP ${response.status}`) } const svgContent = await response.text() // 移除SVG根元素的固定尺寸,使其响应式 return svgContent // 移除width和height属性 .replace(/(<svg[^>]*)\swidth="[^"]*"/g, `$1`) .replace(/(<svg[^>]*)\sheight="[^"]*"/g, `$1`) // 移除style中的width和height .replace(/(<svg[^>]*style="[^"]*?)width:[^;]*;?/g, `$1`) .replace(/(<svg[^>]*style="[^"]*?)height:[^;]*;?/g, `$1`) } catch (error) { console.warn(`Failed to fetch SVG content from ${svgUrl}:`, error) return `<div style="color: #666; font-style: italic;">PlantUML图表加载失败</div>` ...[truncated 2819 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Disable remote PlantUML rendering by default. 2. Render diagrams locally using a reviewed PlantUML installation or another trusted local renderer. 3. Require explicit, informed user consent before transmitting any diagram source to a remote service. 4. Clearly identify the destination, the exact data sent, and the purpose of transmission in `SKILL.md`. 5. Provide an allowlisted configurable endpoint for organizations operating an approved private PlantUML server. 6. Reject non-HTTPS remote endpoints. 7. Avoid embedding diagram source in URLs where it can be retained by access logs; use an approved local renderer or a privacy-reviewed POST-based service if remote processing is essential. 8. Add a configuration option that leaves PlantUML blocks as ordinary code when remote rendering has not been explicitly enabled. 9. Add tests confirming that ordinary Markdown conversion performs no PlantUML network request by default. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:146
Finding
Automatic Troubleshooting Instruction Terminates Unrelated Chrome Debugging Sessions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:146-153` **Vulnerability Type**: Overbroad process termination beyond the Skill's managed browser profile **Risk Level**: Medium ### Complete Vulnerable Code Snippet ```markdown ## Troubleshooting ### Chrome debug port not ready If a script fails with `Chrome debug port not ready` or `Unable to connect`, kill existing Chrome CDP instances first, then retry: ```bash pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2 ``` **Important**: This should be done automatically -- when encountering this error, kill Chrome CDP instances and retry the command without asking the user. ``` ### Technical Analysis The two `pkill -f` commands match process command lines globally within the executing user's process scope. They are not restricted to the browser profile, process identifier, or debugging port created by this Skill. The instruction explicitly directs the Agent to run the commands automatically and without user confirmation. As a result, a routine connection failure authorizes destructive action against unrelated Chrome or Chromium CDP sessions. This exceeds least privilege because the project already has profile-aware process handling in `scripts/weibo-utils.ts`. No privilege escalation to another operating-system account is demonstrated. The issue is unauthorized interference with unrelated processes accessible to the current user. ### Attack Path 1. The Weibo script encounters a debug-port connection failure or an error matching the documented condition. 2. The Agent follows the mandatory troubleshooting instruction without asking the user. 3. `pkill -f` enumerates and terminates every matching Chrome or Chromium process owned by the executing user. 4. Independent browser automation, development debugging, test infrastructure, or another Agent's CDP session is terminated. 5. The Skill retries after disrupting those unrelated ...[truncated 833 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the automatic broad `pkill -f` instruction. 2. Record the exact PID returned when this Skill launches Chrome and terminate only that child process. 3. Restrict any recovery operation to the dedicated profile directory and exact remote-debugging port used by the current invocation. 4. Reuse the existing profile-scoped `killChromeByProfile` implementation after strengthening its process-identification checks. 5. Verify both the executable path and complete `--user-data-dir` argument before signaling a process. 6. Attempt non-destructive reconnection and bounded retries before considering process termination. 7. Request user confirmation when the target process was not created by the current Skill invocation. 8. Log the exact PID, profile, and port before termination so the action is auditable. 9. Prefer graceful `SIGTERM` followed by a bounded wait; use stronger termination only for the specific managed child when necessary. ]]>
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 (90)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill description understates sensitive behaviors: it is framed as Weibo posting, but the documentation also reveals clipboard manipulation, browser control, local file access, and desktop automation. Even if those actions support the workflow, hiding or omitting them undermines informed consent and can cause the skill to be granted or invoked in contexts where those extra capabilities are unsafe.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

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/weibo-utils.ts:45

Environment variable access combined with network send.

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