Back to skill

Security audit

novel-master v2

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Chinese novel-writing workflow, but its helper scripts can read and write outside the intended novel workspace if given crafted project or character names.

Install only if you want a Chinese novel-project workflow that keeps local state under ~/.qclaw. Use simple project and character names without slashes or .., and avoid letting untrusted text choose book or character identifiers until the scripts add path validation and workspace containment checks.

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
scripts/init_book.py:14
Finding

Unvalidated Project Identifiers Allow Filesystem Path Traversal

Content
View full analysis
2 else "" # Create project root directory base_dir = Path.home() / ".qclaw" / "workspace" / "novels" / book_name dirs = [ base_dir / "settings" / "characters", base_dir / "outline", base_dir / "chapters", base_dir / "tracker", ] for d in dirs: d.mkdir(parents=True, exist_ok=True) state = { "book": book_name, "author": author, "current_arc": 1, "current_chapter": 0, "total_words": 0, "unresolved_foreshadowing": 0, "last_updated": "", "status": "drafting" } foreshadowing = {"伏笔列表": []} conflicts = {"冲突列表": []} (base_dir / "state.json").write_text( json.dumps(state, ensure_ascii=False, indent=2), encoding="utf-8" ) (base_dir / "tracker" / "foreshadowing.json").write_text( json.dumps(foreshadowing, ensure_ascii=False, indent=2), encoding="utf-8" ) (base_dir / "tracker" / "conflicts.json").write_text( json.dumps(conflicts, ensure_ascii=False, indent=2), encoding="utf-8" ) (base_dir / "tracker" / "style-log.md").write_text( f"# 文风日志 - {book_name}\n\n## 记录\n", encoding="utf-8" ) (base_dir / "settings" / "world.md").write_text( f"# 世界观设定 - {book_name}\n\n", encoding="utf-8" ) (base_dir / "outline" / "arc-outline.md").write_text( f"# 分卷大纲 - {book_name}\n\n", encoding="utf-8" ) ``` The same unsafe path constructio ...[truncated 4090 chars]
Remediation
View remediation
str: value = value.strip() if ( not value or not IDENTIFIER.fullmatch(value) or value in {".", ".."} or "/" in value or "\\" in value ): raise ValueError(f"Invalid {field}") return value ``` 2. **Enforce canonical path containment** Resolve both the trusted root and candidate path, then verify that the candidate remains beneath the root before every read, write, creation, or directory enumeration. ```python ROOT = ( Path.home() / ".qclaw" / "workspace" / "novels" ).resolve() def confined_path(*parts: str) -> Path: candidate = ROOT.joinpath(*parts).resolve() if not candidate.is_relative_to(ROOT): raise ValueError("Path escapes the novel workspace") return candidate ``` For Python versions without `Path.is_relative_to`, compare using `candidate.relative_to(ROOT)` and reject `ValueError`. 3. **Defend against symbolic-link traversal** Validate resolved paths immediately before access. Where supported, use no-follow filesystem operations or explicitly reject symbolic links in every existing component between `ROOT` and the target. 4. **Separate display names from storage identifiers** Store user-facing book and character names inside JSON, but derive directory names from generated UUIDs or securely normalized slugs. Do not use unrestricted display text as a filesystem path. 5. **Use atomic and non-destructive writes** Write to a temporary file in the same validated directory, flush it, and atomically replace the target. Initialization shou ...[truncated 483 chars]
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向终端用户的小说创作技能,重点在生成内容与创作流程支持;而代码实现的是一个独立的审计器/门禁工具。它通过命令行参数运行,读取本地 novels 工作区中的 ncg.json、plot_bus.json、foreshadowing.json、conflicts.json 及各角色 state.json,执行结构化一致性检查并输出审计结果。虽然代码涉及小说生产流程中的“质量控制/伏笔管理”这一小部分,但它既不负责写作生成,也不覆盖声明中的绝大多数核心能力,因此属于明显的描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

声明强调的是“长篇小说全流程创作”能力,核心应是内容生成与创作辅助;但代码只实现了章节事实的结构化记录与查询:将章节摘要写入 ~/.qclaw/workspace/novels 下的 ncg.json,支持 timeline/character/causal 三种查看方式,按窗口聚合 super nodes,并导出原始 JSON。虽然这些功能与小说写作场景相关,可视为创作流程中的辅助记忆/审计组件,但它们并不能支撑所声明的主要能力,且实际主用途明显偏向剧情图谱管理而非创作生成。因此描述与代码行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

声明描述的是一个广泛的长篇小说创作全流程技能包,而给定代码块的主功能明显更窄,仅用于管理伏笔数据。它不生成小说内容,不进行章节写作、人物设定或大纲规划,也不执行通用质量控制;只是对 ~/.qclaw/workspace/novels/<书名>/tracker/foreshadowing.json 进行增删改查式的状态维护与提醒。虽然“伏笔管理”属于声明范围中的一个子项,但代码行为无法支撑“全链路创作技能包”这一主要描述,因此存在实质性描述-行为不匹配。

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 · README_EN.md (reported line 89)May include surrounding context.

md
### Start Writing

Just tell your AI: **"I want to write a mystery novel"**

The AI will automatically:
1. Load genre references → 2. Generate a Creative Brief → 3. Produce Arc Outlines → 4. Write chapters → 5. Track foreshadowing → 6. Self-check quality

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README says the skill can be started with the phrase "I want to write a mystery novel," which is a common natural-language request rather than a narrowly scoped invocation. The description does not provide any exclusion conditions, alternate exact trigger list, or boundaries for when the skill should or should not auto-activate.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill describes creating and updating project files under a user home-directory workspace and repeatedly references reading/writing tracking state, but it declares no explicit tool scope or allowed-tools. That makes the file-system capability implicit rather than constrained, increasing the chance of unintended local file access when the skill is invoked.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger condition is extremely broad, covering generic requests like writing novels, stories, chaptered fiction, continuous plots, and suspense. Overbroad triggers can cause the skill to activate in many ordinary writing contexts where the user did not intend this workflow, increasing the chance of unnecessary file operations, stateful behavior, or instruction interference with unrelated tasks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description defines the skill as a '中文长篇小说' package and the rest of the document consistently assumes Chinese output as the default operating language. This is a natural-language locale constraint, but the file does not offer the user a language choice or frame the restriction as an explicit opt-in region- or language-specific mode.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, and there is no opt-in, alternative locale, or justification that the skill is intended only for Chinese-speaking users. That can violate a language/locale policy requiring user choice or documented locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The entire skill specification is written as a Chinese-language writing protocol and does not offer any user language choice or opt-in. Under the stated policy, forcing a specific language or locale without user selection is a natural-language policy violation unless the constraint is explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire skill document is written as Chinese-only operational guidance and does not indicate that another language may be used or that the language choice is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

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 is entirely in Chinese and does not provide a language choice, translation, or opt-in mechanism. In a security-relevant workflow, this can prevent some users, reviewers, or downstream operators from understanding gating behavior and audit semantics, increasing the chance of misuse, misconfiguration, or missed security/quality issues.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The title and entire document establish a Chinese-only writing standard, and the file provides prescriptive guidance without indicating that language selection is optional. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and command usage are presented entirely in Chinese, which imposes a specific language on users without any visible opt-in or alternative. This matches the policy category for language or locale constraints that are not user-selectable or explicitly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module documentation states that the auditor performs four checks: name, time, geo, and foreshadow. In code, checks initializes all four dimensions, but only geo and foreshadow are actually evaluated; there is no implemented logic for name or time, and the computed dead set is unused. This is an active contradiction between documented intent and actual behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Several user-visible status and error messages are emitted only in Chinese, such as version warnings and command errors. Because the file does not offer a locale selection mechanism or document a justified region-specific restriction, this is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language text in the docstring and runtime messages is entirely in Chinese, with no option for the user to select another language or any explanation that the tool is intentionally region-specific. This can violate language/locale policy when a skill imposes a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring that explains usage is fully Chinese, and the tool’s runtime messages are also Chinese-only. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, 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
95% confidence
Finding

The module docstring, CLI usage text, and subsequent user-facing messages are written only in Chinese, which imposes a specific language on users without opt-in. Under the policy for natural-language violations, this is a locale/language constraint that is not presented as optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and CLI usage/output strings are exclusively in Chinese, which imposes a specific language on users without offering an opt-in or alternative. Under the stated policy, forcing a language without user choice is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README explicitly instructs users to run initialization and update commands that create and persist files under a local workspace, but it does not clearly warn that these actions will modify the filesystem and maintain ongoing state. In an agent/skill context, silent or poorly disclosed persistent writes can surprise users, overwrite existing project data, or cause an agent to make unintended local changes without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The README prominently describes the skill as a "Publication-Grade Chinese Novel" writing kit, which signals a language/locale constraint. The file does not clearly state that users can choose another language or that the Chinese focus is an explicit opt-in limitation for a region- or language-specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The banner text explicitly presents the skill as a Chinese long-form novel creation package using Chinese-language descriptions, which indicates a fixed language/locale orientation. Under the policy, language constraints should either offer user choice or be clearly documented as justified for a region- or language-specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file contains user-facing guidance exclusively in Chinese, with no indication that other languages are supported or that the user has opted into this locale. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all instructions and content in a single language, Chinese, with no indication that the user can choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.