Back to skill

Security audit

zhihu blog generator

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Zhihu blog generator, but it contains unsafe command execution and path handling that should be reviewed before installation.

Install only if you are comfortable reviewing and fixing the runner first: remove shell execution, validate topic and session inputs, keep outputs in a controlled directory, and manually verify generated technical claims before publishing.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_all.js:12
Finding

Command Injection Through Shell-Backed Subprocess Execution

Content
View full analysis
a.startsWith('--mode='))?.split('=')[1] || 'specific'; const topicArg = args.find(a => a.startsWith('--topic='))?.split('=')[1]; ``` ```js function runScript(scriptName, extraArgs = []) { return new Promise((resolve, reject) => { const scriptPath = path.join(__dirname, scriptName); const allArgs = [scriptPath, `--session=${sessionId}`, ...extraArgs]; console.log(`\n>>> Execute: ${scriptName}`); console.log('----------------------------------------\n'); const child = spawn('node', allArgs, { stdio: 'inherit', shell: true, }); child.on('close', (code) => { if (code === 0) { console.log(`\n<<< ${scriptName} completed`); resolve(); } else { reject(new Error(`${scriptName} exit code: ${code}`)); } }); child.on('error', (err) => { reject(err); }); }); } ``` ```js const topicArgs = topicArg ? [`--topic=${topicArg}`] : []; await runScript('01_topic_selector.js', ['--mode=specific', ...topicArgs]); ``` ### Technical Analysis The `--topic` command-line value is accepted without validation and placed into the argument array passed to `spawn()`. Although array-based argument passing is normally safe, the subprocess is explicitly created with `shell: true`. With shell execution enabled, Node.js delegates command interpretation to the operating-system shell. Shell metacharacters embedded in the topic may therefore be interpreted as command separators, redirections, substitutions, or pipelines instead of remaining literal topic text. The vulnerability is directly reachable through the documented `run_all.js` interface and does not require modification of ...[truncated 1189 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
lib/config.js:8
Finding

Path Traversal Through Unvalidated Session Identifiers

Content
View full analysis
path.join(config.output.baseDir, `blog_${sessionId}`), }, ``` From `lib/file_utils.js`: ```js constructor(sessionId) { this.sessionId = sessionId; this.sessionDir = config.output.getSessionDir(sessionId); } ``` ```js saveJSON(filename, data, dir = '') { const dirPath = dir ? this.getDir(dir) : this.sessionDir; const filePath = path.join(dirPath, filename); fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf8'); return filePath; } ``` ```js readJSON(filename, dir = '') { const dirPath = dir ? this.getDir(dir) : this.sessionDir; const filePath = path.join(dirPath, filename); if (!fs.existsSync(filePath)) { return null; } const content = fs.readFileSync(filePath, 'utf8'); return JSON.parse(content); } ``` From `scripts/02_info_collector.js`: ```js const args = process.argv.slice(2); const sessionId = args.find(a => a.startsWith('--session='))?.split('=')[1]; if (!sessionId) { console.error('Error: provide a session ID, for example: --session=abc123'); process.exit(1); } const logger = new Logger(sessionId); const fileUtils = new FileUtils(sessionId); ``` ### Technical Analysis The orchestrator normally creates an eight-character UUID-derived session identifier, but the individual scripts are publicly documented as standalone commands and accept arbitrary `--session` values. No script verifies that a supplied identifier matches the generated session format. `getSessionDir()` concatenates the attacker-contro ...[truncated 2077 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code is not primarily generating Zhihu-style technical blog posts. Instead, it is a dedicated paper parsing module that accesses local files, uses pdf-parse to read PDFs, extracts structured information from academic papers, and produces a summary markdown block. While such functionality could support a blog generator pipeline, this chunk’s actual purpose is academic paper ingestion and extraction, which is a materially different capability from the declared end-user description. The declared permissions are empty, yet the code reads files from disk and loads a PDF parsing dependency; this further indicates behavior not reflected in the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明将技能描述为“技术博客生成器”,核心承诺是生成文章;但提供的代码块仅实现了第 2 步信息收集。它读取 user_selection.json 中的话题,构造并保存论文与网页内容到本地 JSON/文件,最后提示运行 03_blog_generator.js。虽然信息收集可能是博客生成流程的支持步骤,但就这段代码本身而言,主要目的与声明不一致:它没有生成知乎风格博客正文,而是在执行研究资料采集与持久化。因此应判定为描述与实际行为不匹配。

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

md
node scripts/01_topic_selector.js --mode "hot"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/03_blog_generator.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/04_refine_blog.js

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

文件标题和描述将该技能定义为“知乎技术博客生成器”,整体说明默认面向中文、知乎风格输出,未见任何语言或地区选择、切换或用户同意机制。根据规则,强制特定语言/locale 而无 opt-in 属于自然语言政策问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is described as a '知乎风格技术博客生成器' and the instructions throughout the file prescribe Chinese-language, Zhihu-style article generation as the default behavior. There is no indication that users can opt into another language or locale, which is a natural-language policy concern under the language-choice rule.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly downloads PDFs, saves webpages locally, and preserves parsed content from third-party sources, but the user-facing description does not warn that external content will be stored on disk. This can create privacy, compliance, copyright, and disk-consumption risks, especially if users invoke the skill in sensitive or managed environments expecting ephemeral processing only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file describes the skill as a Zhihu technical blog generator, indicating a fixed Chinese-language target. Under the policy, forcing a specific language or locale without offering user choice or documenting a justified regional constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

In debug mode, the logger prints arbitrary data objects to stdout using JSON.stringify with no filtering or redaction. If upstream code passes prompts, API responses, tokens, user content, filesystem paths, or other sensitive runtime state into data, those values will be exposed in console logs and potentially collected by hosting platforms or CI systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The logger persists accumulated runtime messages to disk with fs.writeFileSync, and there is no indication of retention limits, access controls, or sanitization of logged content. If sensitive operational data is logged earlier in the session, this creates a longer-lived disclosure risk because secrets or private content remain on disk beyond process lifetime.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language description names the tool in Chinese and all user-facing log/messages are written only in Chinese, which indicates a fixed language choice. The policy allows locale constraints only when explicitly justified or offered as an opt-in, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file contains natural-language descriptions in Chinese, starting with the main file header, and does not document that the skill is Chinese-only or offer any language choice. Under the language/locale policy rule, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a Zhihu-style technical blog generator, and this file is documented as a search utility wrapper. While searching sources and collecting topics are consistent with article generation, downloading arbitrary paper PDFs introduces a file-acquisition capability that is not justified by the stated purpose in this file or manifest.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language instructions and console output exclusively in Chinese, starting in the header comments and continuing throughout the script. Because the skill does not offer a user language/locale choice or justify that it is intended only for Chinese-speaking users, it creates a language-policy violation under the locale-choice requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This JavaScript file uses Chinese for its descriptive comments and user-facing console/log messages, such as the CLI error and next-step instructions, with no indication that the skill is region-specific or that users can opt into another language. That creates a natural-language locale policy issue under the rule prohibiting forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JavaScript skill’s comments, logging, quality checks, and generated phrases are all explicitly written in Chinese, and the transformation logic injects Chinese text into the refined blog content. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present in this file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The refinement step claims to deepen the article using collected data, but instead injects fixed benchmark numbers and performance claims without validating them against the actual collectedData input. In a blog-generation skill, this can produce fabricated technical claims that appear evidence-based, misleading readers and potentially causing reputational or trust harm.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code unconditionally inserts prewritten first-person opinions while presenting them as independent views or personal color. In the context of an automated Zhihu-style technical blog generator, this is risky because it fabricates authorial stance and authenticity, which can deceive readers about the origin and credibility of the content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file description states it generates a final document in a Zhihu style, and later code hardcodes Chinese locale formatting and Zhihu-specific completion messaging. This imposes a specific language/platform convention rather than offering a user choice, which matches the policy category for language or locale constraints without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The console output announces completion of a Zhihu technical blog and states the article can be directly copied to Zhihu for publishing. This is user-facing natural language that assumes a single platform/language context without opt-in or configurable target.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language strings and interface text in this skill are entirely in Chinese, including workflow descriptions and prompts, with no indication that language is selectable or that the tool is intentionally restricted to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script launches child processes with shell: true, which unnecessarily invokes a command shell for running local Node scripts. Because command arguments include user-influenced data such as --topic=${topicArg}, this increases command-injection risk if any value is later interpreted by the shell, and the skill’s stated purpose does not require shell access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises multi-source collection and Playwright-based web scraping but does not warn users that running the tool will initiate network access and transmit queries or fetched content to external services. This is not inherently malicious, but the lack of disclosure can lead to unintended data exposure, policy violations, or execution in restricted environments where outbound access should be explicit.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The file presents the skill identity and developer-facing documentation entirely in Chinese (for example, the header naming the tool), with no indication that language choice is configurable or region-specific. Under the policy, forcing a specific language without opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/run_all.js:39