Back to skill

Security audit

novel-multi-agent-skill

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Chinese novel-writing workflow, but its local shell scripts have an input-handling flaw that can turn a chapter range into unintended command execution.

Install only if you are comfortable reviewing and running local shell scripts. Use a fresh, version-controlled project directory, pass only simple numeric ranges such as 1-10, and avoid ranges copied from untrusted sources until the scripts validate input safely.

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
workflow/step4-write.sh:18
Finding

Arbitrary Command Execution Through Unvalidated Chapter-Range Arithmetic

Content
View full analysis
"$OUTPUT_FILE" done ``` Equivalent unvalidated parsing is used in `step3-plot.sh` and `step5-review.sh`. The full-pipeline script forwards the supplied range to all three scripts without validation: ```bash PROJECT_DIR="$1" CHAPTER_RANGE="${2:-1-10}" "$SCRIPT_DIR/step3-plot.sh" "$PROJECT_DIR" "$CHAPTER_RANGE" "$SCRIPT_DIR/step4-write.sh" "$PROJECT_DIR" "$CHAPTER_RANGE" "$SCRIPT_DIR/step5-review.sh" "$PROJECT_DIR" "$CHAPTER_RANGE" ``` ### Technical Analysis `CHAPTER_RANGE` is accepted directly from a command-line argument. Its two components are extracted with `cut`, but neither component is validated as a decimal integer before being used in Bash arithmetic contexts. Bash recursively interprets variable values referenced in arithmetic expressions. Consequently, an attacker-controlled value containing arithmetic syntax, array subscripts, or command substitution can be evaluated when the scripts process expressions such as: ```bash for ((i=START_CHAPTER; i<=END_CHAPTER; i++)) ``` Quoting the original command-line argument does not prevent this issue because the dangerous interpretation occurs later, inside the arithmetic evaluator. An illustrative malicious chapter-range argume ...[truncated 2068 chars]
Remediation
View remediation
&2 exit 1 fi START_CHAPTER=$((10#$START_RAW)) END_CHAPTER=$((10#$END_RAW)) if (( START_CHAPTER < 1 || END_CHAPTER < START_CHAPTER )); then echo "Invalid chapter range: END must be greater than or equal to START." >&2 exit 1 fi MAX_CHAPTERS_PER_RUN=100 if (( END_CHAPTER - START_CHAPTER + 1 > MAX_CHAPTERS_PER_RUN )); then echo "Chapter range exceeds the maximum permitted batch size." >&2 exit 1 fi ``` Apply this validation consistently in: - `workflow/run-full-pipeline.sh` - `workflow/step3-plot.sh` - `workflow/step4-write.sh` - `workflow/step5-review.sh` Additional hardening measures: 1. Validate at both the pipeline entry point and each independently executable step script. 2. Replace the `echo | cut` parsing logic with the regular-expression captures shown above. 3. Never place unvalidated external input in Bash arithmetic contexts. 4. Quote all ordinary variable expansions to prevent word splitting and pathname expansion. 5. Enforce reasonable upper bounds on chapter numbers and batch size to prevent excessive loops, disk consumption, and denial of service. 6. Add negative tests using arithmetic syntax, command substitutions, whitespace, glob characters, empty range components, reversed ranges, and excessively large numbers. 7. Consider enabling stricter shell behavior with `set -euo pipefail`, while recognizing that strict mode does not replace input validation. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (19)

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document states that all agents must strictly follow these rules and later applies them to all projects and all agents, while the content rules require replacing real place names and personal names with Chinese aliases and euphemisms. This effectively forces a Chinese-specific linguistic and locale style without any user opt-in or justification for a region-specific compliance context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, from the title through all operational steps, with no indication that the skill is intended only for Chinese-speaking users or that other language options are available. That can violate a language/locale policy when users are not given an explicit choice or opt-in for a forced language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README instructs users to run initialization and pipeline shell scripts against a target directory without clearly warning that these scripts will create or modify files there. In a skill context, undocumented filesystem side effects can lead users or agents to overwrite project content, make unintended bulk edits, or execute risky automation with insufficient review.

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 skill description, labels, workflow outputs, and configuration are presented only in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-language context. 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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs users to execute local shell scripts that initialize projects and run the full pipeline, but it does not describe what files and directories will be created, modified, or overwritten. That creates a real safety issue because users may run the commands with broad filesystem access without understanding the write side effects, increasing the risk of unintended data loss or workspace modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The entire operational specification, role instructions, notifications, and reporting templates are written exclusively in Chinese, and the file does not indicate that language is optional or limited to a China-specific deployment context. Under the policy rule for natural-language violations, this can amount to forcing a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file defines writing standards entirely in Chinese and states they apply to '所有小说项目,所有章节' and are '永久生效', which makes the locale requirement universal rather than 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, which is not stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file is entirely written as a Chinese-language template and does not indicate that the user may choose another language or locale. Per the policy scope, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.

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 template is entirely written in Chinese and structures the skill's output around Chinese headings and labels, which implies a fixed language requirement. The policy specifically flags language or locale constraints when they are imposed without offering the user a choice or documenting a justified regional limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script presents its title, usage, examples, and subsequent user-facing output entirely in Chinese, which imposes a specific language on users without any opt-in or alternative. The policy for natural-language violations applies to all file types, and there is no indication that this is a region-specific tool or that another locale is supported.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The user-facing natural language throughout the script, including the title, usage instructions, prompts, and completion messages, is entirely in Chinese. This creates a language/locale policy issue because the skill implicitly requires Chinese comprehension and does not provide any opt-in, alternative language, or justification that the tool is intended only for a Chinese-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script presents user-facing instructions, status messages, and errors entirely in Chinese across the file. 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
97% confidence
Finding

This shell script presents its user-facing instructions and status messages exclusively in Chinese, which constitutes a natural-language locale constraint. The file does not offer opt-in language selection or explain that the skill is intentionally restricted to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script’s title, usage text, and all user-facing messages are written in Chinese, which imposes a specific language/locale on users. The file does not offer an opt-in language choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's user-facing title, usage text, and prompts are entirely in Chinese, which imposes a specific language on users. Under the policy, locale or language constraints should be optional, justified, or offer user opt-in; none is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

A language or locale policy issue can arise when a skill effectively forces a specific language without offering user choice. This README presents all instructions and operational guidance only in Chinese, with no note about intended audience, region-specific scope, or alternative language support.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown template presents all headings and instructions exclusively in Chinese, which can amount to a language/locale policy violation when no opt-in or alternative language option is provided. The file does not indicate that it is region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown template presents all instructions, labels, and guidance solely in Chinese. Under the language/locale policy, forcing a specific language without an explicit user choice can be a natural-language policy violation unless the locale restriction is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese across the entire template. Under the policy criteria, forcing a specific language without opt-in can be a natural-language policy violation when no alternative language or explicit locale scope is provided.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.