Back to skill

Security audit

story-review

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its story-review purpose, but it can run project-supplied reviewer agents and write persistent author/project state, so users should review it before installing.

Install only for trusted Chinese fiction-writing workspaces. Prefer solo mode for untrusted projects, and before using full or lean mode inspect any project-local reviewer agents under .codex/agents, .claude/agents, .opencode/agents, or .agents/agents. Be aware it may create or update .story-review/, 追踪/, and .story/作者记忆/ state files.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:9
Finding
Untrusted Project-Local Agent Definitions Can Be Spawned Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:9, 27-29, 41-50, 221-225` **Vulnerability Type**: Untrusted local agent loading and execution **Risk Level**: High ### Relevant Code Snippet The following is an English translation of the relevant Skill instructions: ```text Line 9: Spawn version notice (does not block spawning): first read the agents_version from .story-deployed in the project root. If it differs from agents_version: 30 (including a missing marker, missing or non-integer field, lower version, or higher version), continue checking file existence and spawn normally. Lines 27-29: - /story-review or /story-review full: preferably spawn all four agents. - /story-review lean: preferably spawn story-architect and consistency-checker. - /story-review solo: do not spawn agents. Lines 41-50: 4. Check core agent deployment status in the canonical directory for the current runtime: - Claude Code: .claude/agents/ - OpenCode: .opencode/agents/ - Codex: .codex/agents/ - Antigravity: .agents/agents/ - Required full-mode agents: story-architect, character-designer, narrative-writer, consistency-checker - For Codex agents, the file must be {agent}.toml, parse as TOML, contain name, description, and developer_instructions, and have a matching name. - If any required agent file is missing or malformed, do not spawn the missing or malformed agent; fall back to solo mode. Lines 221-225: Phase 2: Spawn Agents in Parallel Only spawn after Phase 0 when the effective mode remains full or lean. Do not spawn missing agents. ``` ### Technical Analysis The Skill treats project-local custom agent files as trusted once they satisfy basic path and metadata checks. These checks establish only that a file exists, parses successfully, and uses the expected agent name. They do not establish that the file came from a trusted deployment or that its instruction body is safe. In particular, a Codex agent definition is ...[truncated 3450 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Fail closed when deployment provenance is unavailable** - Change the version policy so a missing, malformed, or mismatched `.story-deployed` marker forces `solo` mode. - Do not spawn project-local agents merely because their files exist and parse correctly. 2. **Use a trusted manifest** - Ship a signed or otherwise trusted manifest containing the approved relative path, agent name, version, and cryptographic hash for every agent definition. - Calculate and compare each agent file’s hash before spawning it. - Reject files that are absent from the manifest or whose hashes differ. 3. **Validate complete agent contents** - Compare instruction bodies against trusted deployment artifacts rather than validating only metadata fields. - Reject additional executable hooks, unexpected tool declarations, unknown fields, or instructions that expand the reviewer’s scope. 4. **Separate trusted installed agents from repository-controlled agents** - Prefer agents installed in a protected, user-controlled Skill directory. - Do not automatically load agent definitions from an untrusted project checkout. - If project-local overrides are necessary, require explicit per-project trust approval. 5. **Require informed confirmation for unverified agents** - Display the exact agent file path, source, version, and verification status. - Require explicit user confirmation before spawning an agent whose provenance cannot be cryptographically established. - Do not treat a previously trusted agent name as approval for changed file contents. 6. **Apply least privilege to spawned reviewers** - Grant read access only to the specified review files and required references. - Disable shell, network, credential, and unrestricted filesystem tools unless essential. - Prevent reviewer agents from spawning further agents. - Keep project writes disabled during review except for narrowly defined, validated state ...[truncated 505 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (40)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This duplicate TP4 variant again indicates that the skill contract does not faithfully represent what the system may do. In an agent environment, such discrepancies can lead to unsafe invocation, overbroad trust, and accidental execution of side-effecting operations.

Ae1

High
Category
analysis-evasion
Content
node scripts/normalize-punctuation.js --check <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/normalize-punctuation.js --check <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/check-ai-patterns.js --check --fail-on=blocking <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/check-ai-patterns.js --check --fail-on=blocking <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/check-ai-patterns.js --check --fail-on=blocking <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/check-degeneration.js --check <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/check-degeneration.js --check <正文文件...>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
新追踪协议只有一个写入口:本 skill 的 `scripts/tracking_commit.py`;完整事务字段和命令见 `references/tracking-transaction.md`。**full / lean 模式只允许通过该工具修改 `追踪/`;solo 模式不修改任何 `追踪/` 文件。**不得直
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Self-Modification

High
Category
Rogue Agent
Content
```text
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py init   --project {书项目根} --input {初始化事务.json}
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py check  --project {书项目根}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check   --project {书项目根} --chapter {N}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit  --project {书项目根} --chapter {N} --input {逐章事务.json}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {逐章事务.json}
```
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.

Self-Modification

High
Category
Rogue Agent
Content
```text
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py init   --project {书项目根} --input {初始化事务.json}
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py check  --project {书项目根}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check   --project {书项目根} --chapter {N}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit  --project {书项目根} --chapter {N} --input {逐章事务.json}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {逐章事务.json}
```
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.

Self-Modification

High
Category
Rogue Agent
Content
```text
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py init   --project {书项目根} --input {初始化事务.json}
{PYTHON} {当前 skill 根}/scripts/tracking_commit.py check  --project {书项目根}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter check   --project {书项目根} --chapter {N}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter commit  --project {书项目根} --chapter {N} --input {逐章事务.json}
{PYTHON} {story-long-write skill 根}/scripts/storyctl.py chapter accept-current-length --project {书项目根} --chapter {N} --input {逐章事务.json}
```
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.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file’s behavior materially diverges from the declared skill purpose: instead of only reviewing stories, it maintains and persists cross-workspace author memory and transaction history. In an agent-skill setting, this expands the trust boundary and creates hidden durable state that can influence future outputs, making prompt-injected or mistaken memory writes persist beyond the current review task.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill explicitly instructs the runtime to read files, execute shell commands, and in some paths write persistent state, but it declares no tool/permission scope. That creates an over-privileged, opaque execution surface where a caller cannot reliably tell that project files and shell are in scope before invocation.

Vague Triggers

Medium
Confidence
97% confidence
Finding
Broad natural-language triggers like ‘审查一下’ or ‘帮我审一下’ can cause unintended invocation of a skill that has shell, file-read, and file-write pathways. The context makes this more dangerous than a harmless UX issue because accidental activation could lead to unexpected scans, state writes, or preference recording.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill text includes preference recording and project-state persistence, but those side effects are not prominently disclosed in the main description. Hidden persistence is risky because users invoking a review tool may not expect their preferences or repository state to be stored across sessions.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
Long-term preference learning inside a review skill is a genuine security and privacy concern because it creates cross-session memory without a strong functional need for basic review. Stored preferences can bias future outputs and may capture sensitive workflow habits or author intent.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
A skill advertised as review-only but capable of modifying tracking/state files expands the attack surface from analysis into repository mutation. This is more dangerous in a writing/project workspace because persistent state files can influence later agent behavior and user decisions.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
Line L003 states that the file's sentence length, perspective, punctuation, rhetoric, and banned words are the 'default writing style,' and the entire guidance is written as prescriptive Chinese-language style policy. This imposes a specific language/locale writing standard without any opt-in, fallback, or scope limitation indicating it only applies to Chinese-language projects.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/tracking_commit.py:37