T09 · Insecure Skill Coding Practices
- Location
SKILL.md:123- Finding
User-Controlled Project Names Permit Filesystem Path Traversal
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 123-170
Vulnerability Type: Unsanitized user input used to construct filesystem paths
Risk Level: MediumVulnerable Code Snippet
The following is a faithful English rendering of the relevant workflow:
text "Create novel" | Create a new novel project and initialize the knowledge base and index "Continue [name]" | Load an existing novel and restore its writing state Save process: 1. Receive the save instruction. 2. Write the current content to the corresponding file. 3. Update the timestamp. 4. Confirm that the draft was saved. Load process: 1. Receive the load instruction. 2. Read projects/[novel name]/world_knowledge.json. 3. Read projects/[novel name]/chapter_index.json. 4. Read the final chapter. 5. Load the current draft if present.The same unsafe path-construction behavior is also documented in
README.md, lines 75-105.Technical Analysis
The workflow accepts a novel name from the user and incorporates it directly into filesystem paths beneath
projects/. It does not require validation, canonicalization, separator rejection, or a post-resolution containment check.Consequently, a project name containing traversal components such as
../, platform-specific separators, or an absolute path could resolve outside the intended project directory. The affected operations include project creation, loading, draft saving, chapter completion, metadata updates, and export.This is an insecure path-construction design rather than confirmed malicious behavior. Exploitability depends on how the host agent implements these instructions and on the filesystem permissions available to that agent.
Attack Path
- An attacker supplies a crafted novel name containing traversal components, such as
../../target. - The attacker invokes a supported operation such as loading, saving, completing a chapter, or exportin ...[truncated 1046 chars]
- An attacker supplies a crafted novel name containing traversal components, such as
- Remediation
View remediation
Remediation Suggestions
- Treat the user-provided novel title as a display value only and generate a separate safe project identifier.
- Permit only a conservative identifier format, such as ASCII letters, digits, hyphens, and underscores.
- Reject absolute paths, empty names, dot segments, null bytes, and both Unix and Windows path separators.
- Resolve the project root and requested target to canonical absolute paths before every read or write.
- Verify that the resolved target is a descendant of the canonical
projects/directory. - Apply the same containment validation to project creation, loading, saving, chapter completion, metadata updates, and export.
- Avoid following symbolic links within project directories, or verify containment again after resolving symbolic links.
- Use atomic file creation and replacement APIs where supported.
- Add negative tests for traversal strings, absolute paths, mixed separators, encoded separators, symbolic-link escapes, and names that normalize to parent directories.
- Document that filesystem operations must fail closed when validation or canonicalization cannot be completed.
