Back to skill

Security audit

中国学生教科书目录

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly reads local Chinese textbook data, but it also tells the agent to persist new textbook files from user-provided names without validation or confirmation.

Install only if you are comfortable with a skill that may add or update local textbook JSON files. Before using the new-book workflow, require explicit confirmation and ensure book names are sanitized so they cannot contain path separators, `..`, absolute paths, or overwrite existing files unexpectedly.

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

Warning
Location
SKILL.md:72
Finding

User-Controlled Textbook Name May Permit Path Traversal During File Creation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:72-79; duplicated workflow in README.md:84-89
Vulnerability Type: Path traversal through an unsanitized filename
Risk Level: Medium

Vulnerable Instruction

The affected workflow directs the agent to use the submitted book name directly as part of a filesystem path:

text
## Add a New Book

1. Receive textbook contents from text or an image.
2. Convert the contents into JSON.
3. Write the result to:

   textbooks/<book-name>.json

The workflow does not require validation of the user-controlled book-name value or verification that the resolved destination remains inside the textbooks/ directory.

Technical Analysis

A user who controls the book name may supply path separators, parent-directory components, an absolute path, control characters, or a name resolving through a symbolic link. If the agent follows the documented path template literally, a name such as ../../workspace/notes produces a destination equivalent to:

text
textbooks/../../workspace/notes.json

Path normalization resolves this outside the intended textbook directory. Appending the .json extension reduces the set of files that can be targeted but does not prevent creation or replacement of JSON files elsewhere in the agent's writable filesystem scope.

Exploitation depends on the agent having a file-writing tool and on that tool accepting the resulting path. The reviewed project does not contain executable code that performs the write automatically; the risk arises from the documented agent workflow.

Attack Path

  1. An attacker asks the skill to add a new textbook.
  2. The attacker supplies a crafted book name containing traversal components, such as ../../workspace/notes.
  3. The agent converts the supplied textbook data into JSON.
  4. Following the skill instructions, the agent constructs textbooks/../../workspace/notes.json.
  5. The fil ...[truncated 758 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not use a user-supplied book title directly as a filename. Generate an internal identifier or sanitized filename instead.
  2. Apply a strict allowlist permitting only expected letters, digits, spaces, hyphens, and underscores.
  3. Reject /, \, .., absolute paths, drive prefixes, null bytes, control characters, and reserved filesystem names.
  4. Resolve the canonical destination path before writing and verify that it is a direct child of the canonical textbooks/ directory.
  5. Reject symbolic-link destinations and avoid following symbolic links during file creation.
  6. Use exclusive file creation or require explicit confirmation before replacing an existing file.
  7. Update both SKILL.md and README.md so the documented workflow requires validation and path-confinement checks.
  8. Add negative tests covering parent traversal, absolute paths, mixed path separators, encoded separators, Unicode separator lookalikes, and symbolic-link targets.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (12)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README presents the skill's purpose and operating instructions in Chinese only, and the usage examples and workflow continue in the same language. Because no user opt-in, alternative language option, or explicit justification for a Chinese-only audience is provided, this creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README expands the skill from read-only textbook lookup into a write-capable ingestion workflow that accepts text or images, converts them to JSON, and writes files under textbooks/. That creates capability drift from the declared scope and can enable unauthorized file modification, data poisoning, or abuse of downstream file-writing behavior if an agent follows the README rather than the manifest.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description says the skill should activate when users ask questions like '这学期要学哪些古诗词' or '《朝花夕拾》在哪个单元', but it does not clearly constrain activation to textbook-context queries only. Phrases such as '这学期要学哪些古诗词' are broad enough to overlap with ordinary educational conversation, which could cause unintended invocation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The markdown lists example question types that should trigger the skill, but it does not specify whether these are exhaustive or provide negative examples. Without boundaries, generic questions like '某首诗的作者是谁' or '第一单元有哪些课文' may match many contexts beyond the intended textbook JSON lookup workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is described as a read-only textbook catalog reader, but the documentation also grants it a persistent write path for adding new textbook JSON files. This expands the skill from passive retrieval to data modification without clear authorization, validation, or separation of duties, creating a risk of stored prompt/data poisoning and unintended file changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented ability to ingest user-supplied textbook content and write it into the skill's data store is not necessary for answering catalog lookup questions. Unnecessary write capabilities increase attack surface and can let untrusted users persist malicious or misleading content that later affects future responses.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs writing new textbook JSON files based on user input but does not warn that this modifies persistent skill data. Without an explicit warning and confirmation step, users may unknowingly cause state changes, and attackers may exploit the silent persistence mechanism to poison future lookups.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This JSON uses Chinese as the fixed locale for key user-facing content such as the skill name and section types, with no indication that language choice is optional or that the skill is specifically intended for a Chinese-language context. Under the policy, fixed language/locale behavior without user opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This JSON skill data appears to enforce a single language/locale by providing all names and content labels exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

SQP-3 applies to all file types and covers natural-language policy violations such as forcing a specific language without user opt-in. This JSON dataset is wholly Chinese-language content and provides no indication that the language is optional, user-selected, or justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This JSON file defines the textbook name, unit names, and content titles exclusively in Chinese, which can constitute a language/locale policy issue when no user language choice or opt-in is indicated. The file does not document that the Chinese-only scope is intentional or region-specific beyond the content itself.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This JSON skill content appears to enforce a single language/locale by providing all titles, labels, and structure values in Chinese, with no accompanying indication that the user can choose another language. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.