Back to skill

Security audit

Story Setup

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real writing-project setup skill, but it installs persistent hooks/plugins and includes a browser research workflow with unsafe shell-command templates that should be reviewed before use.

Review the install plan before running it in a real project. Pay particular attention to .claude/settings.local.json, .claude/hooks, .opencode/plugins/story-hooks.ts, .opencode/commands, and .git/hooks/pre-commit. Avoid using the CDP/browser research path with sensitive logged-in browser sessions, and patch or disable the story-researcher shell-command workflow until values are validated and safely serialized.

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:123
Finding

Shell Command Injection Through Unvalidated Research Parameters and Web-Derived URLs

Content
View full analysis
a.href&&!a.href.includes("google.com")&&!a.href.includes("bing.com")&&!a.href.includes("javascript:")).slice(0,10).map(a=>({text:a.innerText.trim().substring(0,100),href:a.href})))' ``` ```bash # Navigate using the extracted URL agent-browser --cdp {cdp_port} eval "window.location.replace('{extracted URL}')" agent-browser --cdp {cdp_port} wait 5000 # Verify page loading agent-browser --cdp {cdp_port} snapshot 2>&1 | head -20 # Extract page text agent-browser --cdp {cdp_port} eval 'document.body.innerText.substring(0,8000)' ``` ### Technical Analysis The researcher agent is granted the `Bash` tool and is instructed to construct shell commands by directly substituting three potentially untrusted values: 1. The externally supplied `cdp_port` parameter. 2. A search term derived from the research request. 3. A target URL extracted from an untrusted search-result page. These values are not constrained by a strict grammar and are not encoded for both the shell and JavaScript contexts. The apparent JavaScript quoting does not provide shell protection. In particular, the search term and extracted URL are placed inside a ...[truncated 2461 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (115)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill states it is for environment setup, but it also installs commit-time validation logic that inspects staged files and Git state during future commits. Modifying .git/hooks/pre-commit and enabling repository-content checks is a persistent behavioral change with security and operational consequences, not merely setup. The risk is amplified because Git hooks run in a trusted local workflow and may process sensitive staged content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill states it is for environment setup, but it also installs commit-time validation logic that inspects staged files and Git state during future commits. Modifying .git/hooks/pre-commit and enabling repository-content checks is a persistent behavioral change with security and operational consequences, not merely setup. The risk is amplified because Git hooks run in a trusted local workflow and may process sensitive staged content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill states it is for environment setup, but it also installs commit-time validation logic that inspects staged files and Git state during future commits. Modifying .git/hooks/pre-commit and enabling repository-content checks is a persistent behavioral change with security and operational consequences, not merely setup. The risk is amplified because Git hooks run in a trusted local workflow and may process sensitive staged content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill states it is for environment setup, but it also installs commit-time validation logic that inspects staged files and Git state during future commits. Modifying .git/hooks/pre-commit and enabling repository-content checks is a persistent behavioral change with security and operational consequences, not merely setup. The risk is amplified because Git hooks run in a trusted local workflow and may process sensitive staged content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill states it is for environment setup, but it also installs commit-time validation logic that inspects staged files and Git state during future commits. Modifying .git/hooks/pre-commit and enabling repository-content checks is a persistent behavioral change with security and operational consequences, not merely setup. The risk is amplified because Git hooks run in a trusted local workflow and may process sensitive staged content.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Browser control and data scraping are not justified by a writing-environment bootstrap function, making this an unnecessary high-risk capability in context. Because the description explicitly mentions reusing an existing logged-in browser session, the skill could access sensitive user data or trigger actions on external sites under the user's identity.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file instructs use of a browser automation skill that can control Chrome and scrape data, which is materially different from the enclosing skill's declared purpose of setting up writing-project infrastructure. This capability expansion creates an unjustified path to access authenticated browser content and perform actions outside the user's expected setup workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The command file is declared under the story-setup skill context, but its behavior and prompt text invoke story-cover instead. This mismatch can cause the wrong capability to be executed, violating user expectations and potentially bypassing review boundaries or permission assumptions tied to the setup workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The command file belongs to the 'story-setup' skill context, but its description and body explicitly invoke a different skill, 'story-deslop'. This kind of skill/command mismatch can cause unintended tool execution, confuse routing and review processes, and create an opportunity for hidden or substituted behavior to be triggered under an unrelated, trusted skill name.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The command file advertises and invokes a long-form novel analysis skill, while the declared skill metadata describes infrastructure deployment into a user's project directory. This mismatch can cause the agent to route user requests to unintended functionality, undermining user consent and review boundaries and creating a confused-deputy risk if the wrong skill is executed under a trusted name.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The referenced command file advertises and invokes a long-form novel writing skill, while the surrounding skill metadata says this skill should deploy project writing infrastructure. This mismatch can cause the agent to execute an unintended capability, violating user expectations and weakening command/skill boundary integrity.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The command file’s declared behavior is unrelated to the manifest-described skill purpose. A skill advertised as project environment setup but actually invoking a short-story analysis workflow can misroute user intent, trigger the wrong downstream capability, and undermine trust and policy scoping around when the skill should run.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The command file's behavior is materially inconsistent with the declared skill purpose. A skill advertised as project/environment setup but containing a command that invokes short-story writing can cause unintended capability activation, confuse policy boundaries, and enable users or downstream agents to trigger unrelated behavior under a trusted setup label.

Content

No source excerpt is available for this finding.

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-short-write skill,帮助我进行短篇网文写作。

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,帮助我进行短篇网文写作。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/templates/hooks/session-start.sh (reported line 34)May include surrounding context.

sh
OUTPUT+="[INFO] story-setup 刚部署/更新了 agents,本会话已重新加载——story-architect、narrative-writer 等 custom agent 现已注册可用。\n"
  OUTPUT+="  若写作 skill 仍提示 spawn 失败 / 降级 solo,说明你还在部署时的旧会话里,请再新开一个 Claude Code 会话。\n\n"
  HAS_CONTENT=true
  rm -f "$ROOT/.claude/.agents-pending-restart" 2>/dev/null || true
fi

# 部署自检:.story-deployed 存在但 hooks 文件被误删时发出警告

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill specifies broad filesystem and environment-interacting behavior but does not declare an explicit tool/permission scope. That makes it harder for users and enforcement layers to understand or constrain what the skill may access during setup, especially since it reads project state and writes multiple managed files. In a deployment skill that modifies configuration and hook files, missing scope declaration meaningfully increases the risk of overbroad access and surprise behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description does not prominently warn that the skill can modify many project files, merge configuration, install persistent hooks/plugins, and alter .git/hooks/pre-commit. For a setup skill, lack of an upfront modification warning undermines informed consent and can lead users to approve broad, durable changes they would otherwise review more carefully. This is more dangerous in the current context because the installed components continue to execute after setup.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases include broad everyday-language requests such as '帮我搭一下环境' and '配置写作项目,' which could accidentally invoke a skill that writes many files and alters hooks/configuration. Unintended activation is particularly risky here because the skill performs persistent project modifications rather than a read-only action. Broad triggers therefore increase the chance of accidental installation or modification without deliberate user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire upgrade guide is written only in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Per the policy, a fixed language/locale requirement 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 title and all guidance are written as a prescriptive Chinese-language style guide, and the checklist later enforces specific Chinese punctuation and wording norms. This effectively forces a specific language/locale behavior for the skill without any opt-in or stated regional justification, which matches the language/locale policy violation category.

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 is entirely written as Chinese-only instructions and immediately directs the agent to load and use this template, with no indication that users may choose another language or that the locale restriction is required for a region-specific purpose. This creates a natural-language policy issue because the skill effectively 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
96% confidence
Finding

This markdown skill forces a specific language/locale for all instructions and examples, and there is no natural-language indication that users may choose another language or that the skill is intended only for a Chinese-speaking context. Under the policy, a fixed 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
88% confidence
Finding

This markdown guidance explicitly instructs the writer to select distinct content logic for 男频 and 女频 and states the two must not be mixed. That imposes a fixed audience/gendered framing in the skill content without any opt-in, alternative framing, or justification such as a narrowly documented regional or market-specific requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains all operational guidance in Chinese, including the activation/use description and detailed instructions, with no indication that users may choose another language. Under the policy for natural-language violations, forcing a specific language without user opt-in is reportable unless the locale restriction is explicitly justified.

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
references/opencode/plugin.ts:16