Back to skill

Security audit

story-long-write:长篇网文写作

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this writing skill suspicious because scanners confirmed concerns about output paths and file changes, while several other checks found no strong purpose mismatch; coverage was partial.

Consider the verdict suspicious before installing. Review whether the skill’s file-writing behavior and tool scope are appropriate for your setup, especially the reported ability to write to explicit output paths and the possible loss of outline identifiers. Scanner coverage was partial: 79 of 87 components were fully inspected and 8 were only partially inspected, so the results do not establish that the remaining contents are safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/tracking-transaction.md (reported line 25)May include surrounding context.

{PYTHON} {当前 skill 根}/scripts/tracking_commit.py init --project {书项目根} --input {书项目根}/.story/work/init.json {PYTHON} {当前 skill 根}/scripts/tracking_commit.py check --project {书项目根} {PYTHON} {当前 skill 根}/scripts/tracking_commit.py draft --project {书项目根} --chapter {N} {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check --project {书项目根} --chapter {N} [--min-chars {下限} --max-chars {上限}] {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json

text

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/tracking-transaction.md (reported line 26)May include surrounding context.

{PYTHON} {当前 skill 根}/scripts/tracking_commit.py check --project {书项目根} {PYTHON} {当前 skill 根}/scripts/tracking_commit.py draft --project {书项目根} --chapter {N} {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check --project {书项目根} --chapter {N} [--min-chars {下限} --max-chars {上限}] {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json

text

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/tracking-transaction.md (reported line 27)May include surrounding context.

{PYTHON} {当前 skill 根}/scripts/tracking_commit.py draft --project {书项目根} --chapter {N} {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check --project {书项目根} --chapter {N} [--min-chars {下限} --max-chars {上限}] {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json {PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {书项目根}/.story/work/第{NNN}章/tracking.json

text

- `init`:仅在 `_tracking-state.json` 不存在时执行(旧追踪文件自动移入 `追踪/_旧追踪存档/`);执行前读 [tracking-initialization.md](tracking-initialization.md)。

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/build_writer_prompt.py (reported line 693)May include surrounding context.

python
prompt = "\n\n".join(parts) + "\n"

    return prompt, []


def main(argv=None):

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/build_writer_prompt.py (reported line 400)May include surrounding context.

python
command += ["--genre", genre]
            if workflow:
                command += ["--workflow", workflow]
            completed = subprocess.run(command, capture_output=True, text=True, encoding="utf-8", check=False)
            try:
                result = json.loads(completed.stdout or "{}")
            except ValueError:

Explicit --out paths bypass the documented book-local work-directory restriction.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

An explicit --out value is accepted without checking that its destination remains within the chapter's book-local work directory, and opening it in write mode truncates existing files. If an attacker can influence this argument or induce the agent to supply it, generated prompt content can overwrite files elsewhere under the process's filesystem permissions, contrary to the documented containment restriction.

Content

No source excerpt is available for this finding.

The verifier rejects unknown field values despite documenting a structural-only contract that permits them.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The module documentation at L010–L013 explicitly says that verification only checks structure and that values may be unknown using [待补充]. However, L243–L258 introduce a blocking check that rejects this placeholder for two required fields; L380–L386 also require a concrete numeric word-count target. Thus an outline satisfying the documented placeholder policy can fail verification and trigger requests to supply story decisions.

Content

No source excerpt is available for this finding.

The format-only migration can delete a plot-unit identifier without preserving it in a heading comment.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The migration unconditionally deletes matching unit-ID field lines, but only creates replacement heading comments under separate conditions. A legacy section whose identifier appears only in that field can therefore lose its identifier when the original file is overwritten, damaging manuscript metadata and downstream unit selection despite the format-only promise.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/convert_outline_format.py (reported line 399)May include surrounding context.

python
status = 0
    if not args.dry_run:
        for path in volumes:
            result = subprocess.run([sys.executable, str(HERE / "outline_view.py"), "--check", str(path)],
                                    capture_output=True, text=True, encoding="utf-8")
            summary = result.stdout.strip().splitlines()[-1] if result.stdout.strip() else result.stderr.strip()
            print(f"{path.name} 检查:{summary}")

Undeclared sections are silently promoted to volume-wide scope, contradicting the documented scope and warning policy.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The documentation at L004 and L012 says undeclared sections are included conservatively with a warning, and that unannotated children of volume-wide sections remain undeclared. However, L226–L232 assigns volume-wide scope to every section lacking both scope and a unit ID whenever any inline annotation exists, suppressing undeclared-section warnings and strict-check errors and including those sections as permanent material in scoped output.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/storyctl.py (reported line 264)May include surrounding context.

python
if not path.is_file():
            tool_errors.append({"type": "TOOL_UNAVAILABLE", "tool": script, "message": f"missing {script}"})
            continue
        completed = subprocess.run(
            [node, str(path), "--check", "--json", "--fail-on=blocking", str(body)],
            text=True, encoding="utf-8", capture_output=True, check=False,
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/storyctl.py (reported line 289)May include surrounding context.

python
tool_errors.append({"type": "TOOL_UNAVAILABLE", "tool": punctuation.name,
                            "message": "missing normalize-punctuation.js"})
    else:
        completed = subprocess.run(
            [node, str(punctuation), "--check", str(body)],
            text=True, encoding="utf-8", capture_output=True, check=False,
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/storyctl.py (reported line 306)May include surrounding context.

python
tool_errors.append({"type": "TOOL_UNAVAILABLE", "tool": outline_copy.name,
                            "message": "missing check-outline-copy.js"})
    else:
        completed = subprocess.run(
            [node, str(outline_copy), "--outline", str(outline), str(body)],
            text=True, encoding="utf-8", capture_output=True, check=False,
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/storyctl.py (reported line 427)May include surrounding context.

python
if node is None or not script.is_file():
        return False  # chapter check reports the missing tool in quality.tool_errors
    before = body.read_bytes()
    subprocess.run([node, str(script), str(body)], text=True, encoding="utf-8",
                   capture_output=True, check=False)
    return body.read_bytes() != before

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/storyctl.py (reported line 36)May include surrounding context.

python
core = _load_local_module("story_wordcount_core", "wordcount_core.py")
for _name in dir(core):
    if not _name.startswith("_"):
        globals()[_name] = getattr(core, _name)

CHAPTER_CHECK_SCHEMA = "story-chapter-check/v1"
CHAPTER_ERROR_SCHEMA = "story-chapter-error/v1"