Back to skill

Security audit

story-setup:网文写作工具集基础设施部署

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because it reports an unescaped URL-to-shell command risk, risky installation guidance, and behavior that extends beyond the stated setup purpose; some analysis was incomplete.

Consider the reported command-injection risk, unpinned installation commands, possible backup deletion, and writing hooks that may inspect or restrict manuscript work before installing. The verdict is suspicious, not malicious; ClawScan reports no finding establishing harmful intent. Analysis was partial, so the scan cannot establish that all behavior is safe.

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

Error
Location
references/templates/agents/story-researcher.md
Finding

Search-result URLs are interpolated into shell commands without escaping

Content
View full analysis

Impact

A selected HTTPS URL containing a literal command substitution, such as https://example.org/$(id), causes the shell to execute the substitution locally. An attacker can substitute other commands within the agent's effective permissions; browser navigation need not succeed for expansion to occur.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (54)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose covers writing-environment deployment and verification, whereas this chunk performs webpage retrieval and content extraction. Although research may support writing generally, the supplied code does not connect these actions to infrastructure setup or environment checks, making this an undeclared capability rather than a supporting implementation detail.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose concerns configuring and validating a writing environment. The supplied command instead reads links from a live browser page, apparently to support research. Nothing in this chunk connects that browser-content extraction to infrastructure setup or environment validation. It shows no exfiltration or modification, but its browser-reading capability is outside the stated purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description focuses on environment deployment and checking. Although agent hooks can support that infrastructure, this module primarily implements ongoing manuscript-content validation and writing-workflow enforcement, which materially exceeds environment setup or health checks. It reads manuscript contents, outlines, tracking files, and style whitelists, and invokes a read-only Git diff command. The supplied chunk exports these functions rather than installing or automatically invoking them; no file modification or network transmission is shown.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Agent-adapter utilities and project discovery reasonably support the declared infrastructure purpose. However, this chunk also implements substantive, ongoing editorial checks and workflow enforcement, rather than merely deploying or checking the writing environment. Those capabilities are not disclosed by the description. The module exports functions and returns findings or blocking reasons; the supplied chunk does not itself install hooks, reject tool calls, or modify manuscripts. Its visible subprocess use is a read-only git diff, with no evident network access or exfiltration.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The supplied commands perform a Google search rather than deploy, configure, or inspect a writing environment. Although the file is under an OpenCode integration directory, its research behavior is not described as part of the declared setup-and-check purpose, and the snippet provides no indication that the search supports an environment check.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Agent-adapter utilities and project discovery support the declared infrastructure purpose. However, this module substantially extends into ongoing editorial inspection and writing-workflow enforcement, not merely environment deployment or checks. Functions such as proseBlockReason, proseAfterWrite, toxicPhraseFindings, and stagedMarkdownWarnings read manuscript and tracking files and produce blocking reasons or editorial warnings. These significant runtime capabilities are not disclosed in the description. The supplied chunk exports helpers rather than installing hooks or directly preventing writes; enforcement depends on its callers. No network transmission or destructive file operations are shown.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description promises infrastructure deployment and environment checks, whereas this chunk primarily implements ongoing manuscript-content auditing and writing-workflow gates. These are substantive capabilities beyond checking whether the writing environment is installed or configured. Agent-hook integration is consistent with the declared purpose, but the content restrictions those hooks support are not disclosed. The functions return findings or blocking reasons; the supplied module does not itself intercept writes. No network access, exfiltration, or file modification is shown, and its subprocess invocation is a fixed Git inspection command.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared purpose concerns installing and checking the writing environment, whereas this chunk performs ongoing inspection of manuscript content after edits. Checking for incomplete writes could support environment diagnostics, but analyzing prose patterns and recommending rewrites is a distinct, undeclared capability. The hook is nonblocking and shows no network transfer or direct manuscript modification; the mismatch concerns its content-analysis purpose and post-write activation, not malicious behavior. The shared checker implementation is not supplied, so its exact detection behavior cannot be independently verified here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The Codex JSON adapter, project discovery, deployment-marker checks, and local Git inspection are reasonable supporting infrastructure. However, this chunk also implements substantive editorial and workflow enforcement during normal writing. In particular, pre_tool_prose_guard can return permissionDecision='deny', including when the preceding chapter contains flagged stylistic patterns. Those capabilities materially exceed checking or configuring the writing environment and are not disclosed by the description. The supplied code shows no network exfiltration or direct manuscript modification; the mismatch concerns undisclosed runtime inspection and enforcement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

Although an agent-hook template can support infrastructure deployment, this template implements substantive writing-workflow and content-policy enforcement, not merely environment setup or diagnostics. Its blocking behavior is not disclosed by the description. The visible code reads local project files and invokes a shared Node CLI; there is no visible evidence of exfiltration or unrelated destructive actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The deployment checks, project discovery, hook-contract translation, and local pending-state storage reasonably support the declared integration infrastructure. However, the adapter also actively enforces a writing workflow: preToolUse can deny operations through proseBlockReason; postToolUse collects proseAfterWrite findings; preInvocation injects correction demands; and stop can return a continue decision once for unresolved findings. These are substantive runtime writing-enforcement capabilities not disclosed by a description limited to infrastructure deployment and environment checking. The exact validation rules reside in the unavailable shared core, so this assessment concerns the enforcement behavior visible in this chunk rather than inferred rule details.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

The OpenCode integration and local filesystem/Git inspection are consistent with supporting an adapter. However, this chunk goes beyond installing or checking writing infrastructure: it actively governs later writing operations and modifies information presented to the model during normal sessions. Those ongoing writing-control capabilities are not disclosed by the setup-and-environment-check description. The precise validation rules reside in an imported module and cannot be fully verified from this chunk, but the conditional blocking and result augmentation are explicit. No network transmission or exfiltration is visible.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
ttings.py`、`scripts/merge-codex-hooks.py`、`scripts/merge-antigravity-hooks.py`、`scripts/generate-antigravity-agents.mjs`、`scripts/deploy-antigravity-skills.py`、

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The documented alternative pipes a remotely fetched, mutable script directly into bash without inspection or integrity verification. HTTPS protects transport but does not prevent a compromised distribution endpoint from executing arbitrary commands with the user's privileges; the legitimate setup context does not remove this risk.

Content

Scanner excerpt · UPGRADING.md (reported line 89)May include surrounding context.

md
OpenCode 2.0 起发布在 npm 包 `@opencode/cli`(`opencode-ai` 停在 1.x)。本适配只支持 2.x:1.x 的插件 loader 读不了新版 `story-hooks.ts`,在 1.x 上会没有写正文守卫与写后兜底;1.x 也不认 agents 的 `permissions:` 规则,只读 agent 会失去权限限制。story-setup 在版本是 1.x 或无法确定时停止部署。

1. 升级 OpenCode:先卸载旧包 `npm rm -g opencode-ai`,再 `npm i -g @opencode/cli`(或 `curl -fsSL https://opencode.ai/v2/install | bash`),确认 `opencode --version` 为 2.x。两个包都提供 `opencode` 命令,不先卸载旧包时 PATH 上可能仍是 1.x。
2. 更新技能包后,在写作项目根重跑 story-setup:替换 `.opencode/plugins/story-hooks.ts` 与 `.opencode/agents/`(改为 2.x 原生 `permissions:` 规则列表,已配的 `model:` 会保留),并从 `opencode.json` / `opencode.jsonc` 删除旧的 story-hooks 插件注册。

## 插件打包身份迁移(v0.7.9 同版本修复)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · references/antigravity/hooks/story_antigravity_hook.js (reported line 159)May include surrounding context.

js
const key = path.resolve(target)
    const finding = core.proseAfterWrite(root, key)
    if (finding) state.findings[key] = finding
    else delete state.findings[key]
    changed = true
  }
  if (changed) {

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/codex/agents/narrative-writer.toml (reported line 58)May include surrounding context.

toml
| `story-setup/references/agent-references/opening-design.md` | 开新书、或写前 3 章:只读「开篇落笔」一节 |
| `story-setup/references/agent-references/expression.md` + `story-setup/references/agent-references/narrative-focus.md` + `story-setup/references/agent-references/story-logic.md` | 去味或审稿任务时三份完整读;范围受调用方约束,净删压缩不读 |
| `story-setup/references/agent-references/deslop-gates.md` | 去味或审查前读范围映射、执行边界与验收 |
| prompt「本章技法」写的那一份 | 写正文时读(类别与 story-long-write SKILL.md「本章技法」同步):打脸 `story-setup/references/agent-references/style-combat-face.md`、反转 `story-setup/references/agent-references/long-reversal.md`、感情 `story-setup/references/agent-references/long-emotional-methods.md`(含「两种场景情绪结构」)、悬疑 `story-setup/references/agent-references/long-suspense.md`、日常装逼 `story-setup/references/agent-references/style-combat-face.md`「爽点公式与日常装逼」一节;「无」不读 |
| `story-setup/references/agent-references/dialogue-mastery.md` | 写或改写正文且本章有对话时,审查不读(潜台词/信息控制/权力博弈;排版层不采纳其裸引语示例,对话落法以书级文风为准) |
| `story-setup/references/agent-references/genre-prose-c

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/opencode/agents/narrative-writer.md (reported line 79)May include surrounding context.

md
| `story-setup/references/agent-references/opening-design.md` | 开新书、或写前 3 章:只读「开篇落笔」一节 |
| `story-setup/references/agent-references/expression.md` + `story-setup/references/agent-references/narrative-focus.md` + `story-setup/references/agent-references/story-logic.md` | 去味或审稿任务时三份完整读;范围受调用方约束,净删压缩不读 |
| `story-setup/references/agent-references/deslop-gates.md` | 去味或审查前读范围映射、执行边界与验收 |
| prompt「本章技法」写的那一份 | 写正文时读(类别与 story-long-write SKILL.md「本章技法」同步):打脸 `story-setup/references/agent-references/style-combat-face.md`、反转 `story-setup/references/agent-references/long-reversal.md`、感情 `story-setup/references/agent-references/long-emotional-methods.md`(含「两种场景情绪结构」)、悬疑 `story-setup/references/agent-references/long-suspense.md`、日常装逼 `story-setup/references/agent-references/style-combat-face.md`「爽点公式与日常装逼」一节;「无」不读 |
| `story-setup/references/agent-references/dialogue-mastery.md` | 写或改写正文且本章有对话时,审查不读(潜台词/信息控制/权力博弈;排版层不采纳其裸引语示例,对话落法以书级文风为准) |
| `story-setup/references/agent-references/genre-prose-c

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/templates/agents/narrative-writer.md (reported line 63)May include surrounding context.

md
| `story-setup/references/agent-references/opening-design.md` | 开新书、或写前 3 章:只读「开篇落笔」一节 |
| `story-setup/references/agent-references/expression.md` + `story-setup/references/agent-references/narrative-focus.md` + `story-setup/references/agent-references/story-logic.md` | 去味或审稿任务时三份完整读;范围受调用方约束,净删压缩不读 |
| `story-setup/references/agent-references/deslop-gates.md` | 去味或审查前读范围映射、执行边界与验收 |
| prompt「本章技法」写的那一份 | 写正文时读(类别与 story-long-write SKILL.md「本章技法」同步):打脸 `story-setup/references/agent-references/style-combat-face.md`、反转 `story-setup/references/agent-references/long-reversal.md`、感情 `story-setup/references/agent-references/long-emotional-methods.md`(含「两种场景情绪结构」)、悬疑 `story-setup/references/agent-references/long-suspense.md`、日常装逼 `story-setup/references/agent-references/style-combat-face.md`「爽点公式与日常装逼」一节;「无」不读 |
| `story-setup/references/agent-references/dialogue-mastery.md` | 写或改写正文且本章有对话时,审查不读(潜台词/信息控制/权力博弈;排版层不采纳其裸引语示例,对话落法以书级文风为准) |
| `story-setup/references/agent-references/genre-prose-c

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/zcode/agents/narrative-writer.md (reported line 62)May include surrounding context.

md
| `story-setup/references/agent-references/opening-design.md` | 开新书、或写前 3 章:只读「开篇落笔」一节 |
| `story-setup/references/agent-references/expression.md` + `story-setup/references/agent-references/narrative-focus.md` + `story-setup/references/agent-references/story-logic.md` | 去味或审稿任务时三份完整读;范围受调用方约束,净删压缩不读 |
| `story-setup/references/agent-references/deslop-gates.md` | 去味或审查前读范围映射、执行边界与验收 |
| prompt「本章技法」写的那一份 | 写正文时读(类别与 story-long-write SKILL.md「本章技法」同步):打脸 `story-setup/references/agent-references/style-combat-face.md`、反转 `story-setup/references/agent-references/long-reversal.md`、感情 `story-setup/references/agent-references/long-emotional-methods.md`(含「两种场景情绪结构」)、悬疑 `story-setup/references/agent-references/long-suspense.md`、日常装逼 `story-setup/references/agent-references/style-combat-face.md`「爽点公式与日常装逼」一节;「无」不读 |
| `story-setup/references/agent-references/dialogue-mastery.md` | 写或改写正文且本章有对话时,审查不读(潜台词/信息控制/权力博弈;排版层不采纳其裸引语示例,对话落法以书级文风为准) |
| `story-setup/references/agent-references/genre-prose-c

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · references/deploy-claude-code.md (reported line 57)May include surrounding context.

md
先看 `.claude/settings.local.json` 是否存在:存在则读取现有配置,后续合并;不存在则由 helper 创建新文件。

1. 按现有跨平台规则探测 Python:`for PYBIN in python3 python py; do "$PYBIN" -c "" 2>/dev/null && break; done`;无可用解释器时停止,不手写或简化合并。
2. 调用 `"$PYBIN" "{story-setup skill目录}/scripts/merge-claude-settings.py" --existing "{项目}/.claude/settings.local.json" --template "{story-setup skill目录}/references/templates/settings-hooks.json" --output "{项目}/.claude/settings.local.json"`。
3. helper 会移除所有已知 story-setup hook 的历史注册,再追加当前模板;因此 matcher/timeout/if 能随版本升级,同时混在旧 block 中的用户 hook 与未知顶层字段原样保留。写后解析 JSON,验证模板命令各一份、用户配置仍在,再复跑 helper 比较文件字节确认幂等。

## 部署标记补充

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · references/deploy-claude-code.md (reported line 57)May include surrounding context.

md
先看 `.claude/settings.local.json` 是否存在:存在则读取现有配置,后续合并;不存在则由 helper 创建新文件。

1. 按现有跨平台规则探测 Python:`for PYBIN in python3 python py; do "$PYBIN" -c "" 2>/dev/null && break; done`;无可用解释器时停止,不手写或简化合并。
2. 调用 `"$PYBIN" "{story-setup skill目录}/scripts/merge-claude-settings.py" --existing "{项目}/.claude/settings.local.json" --template "{story-setup skill目录}/references/templates/settings-hooks.json" --output "{项目}/.claude/settings.local.json"`。
3. helper 会移除所有已知 story-setup hook 的历史注册,再追加当前模板;因此 matcher/timeout/if 能随版本升级,同时混在旧 block 中的用户 hook 与未知顶层字段原样保留。写后解析 JSON,验证模板命令各一份、用户配置仍在,再复跑 helper 比较文件字节确认幂等。

## 部署标记补充

External Script Fetching

High
Category
Supply Chain
Confidence
97% confidence
Finding

The suggested upgrade command pipes a mutable remote installer directly into Bash without integrity verification or review. A compromised distribution endpoint could execute arbitrary commands with the user's privileges; presenting this as a manual installation option reduces automatic exposure but does not remove the risk.

Content

Scanner excerpt · references/deploy-opencode.md (reported line 11)May include surrounding context.

md
1. 运行 `opencode --version`,取第一个 `主.次.修` 版本号:
   - 主版本 ≥ 2 → 继续
   - 主版本 < 2 → 停止 OpenCode 部署(其它 target 照常),告诉用户先升级到 2.x(先 `npm rm -g opencode-ai`,再 `npm i -g @opencode/cli` 或 `curl -fsSL https://opencode.ai/v2/install | bash`),装好后重跑 story-setup
   - 命令不可用或解析不出版本 → 同样停止 OpenCode 部署,请用户在自己的终端运行 `opencode --version`:用户在对话里确认显示 2.x 后才继续;是 1.x 按上一条处理
   - 停止 OpenCode 部署时:target 只有 opencode 则不写、不更新 `.story-deployed`(已有的原样保留,不抬 `agents_version`),也不写任何 OpenCode 文件;多 target 时其它端照常部署,写入的 `target_cli` 不含 opencode;安装报告「现在可以做什么」只写装上的端,「你还需要做的事」里用白话说 OpenCode 这次没装上及原因(如版本太旧),升级后重新部署时选把它加回来
2. 插件由 OpenCode 自动发现 `.opencode/plugins/*.ts` 加载,不写 `opencode.json`。项目根已有 `opencode.json` / `opencode.jsonc` 时,从其 `plugin`、`plugins` 数组删掉指向 `.opencode/plugins/story-hooks.ts` 的项(旧版部署留下;2.x 丢弃单文件路径并告警),数组删空就删掉该键,其余内容原样保留。

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/diagnostics.md (reported line 29)May include surrounding context.

使用已安装 story-long-write skill 的现有校验器:

bash
"$PYBIN" -B "{story-long-write skill目录}/scripts/tracking_commit.py" check --project "{书根}"

PYBIN 是前面已成功探测的 Python 3。这个 check 校验追踪状态及自动生成的追踪文件;不要用「JSON 能解析」代替它。缺解释器、校验器或其依赖时报告未能完成检查,不另写简化校验器,也不调用 init / commit 修复。追踪问题沿用 UPGRADING.md 的迁移说明和现有追踪事务流程。

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/opencode/commands/story-long-write.md (reported line 5)May include surrounding context.

md
description: 长篇网文写作。从大纲到正文,辅助长篇网络小说的创作。
---

请使用 story-long-write skill,帮助我进行长篇网文写作。

用户参数:$ARGUMENTS

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/opencode/commands/story-short-write.md (reported line 5)May include surrounding context.

md
description: 短篇网文写作。辅助短篇小说创作,从构思到成稿。
---

请使用 story-short-write skill,帮助我进行短篇网文写作。

用户参数:$ARGUMENTS