T09 · Insecure Skill Coding Practices
- Location
SKILL.md:133- Finding
Unrestricted Output Paths and Predictable File Overwrite Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:133-158,SKILL.md:480
Vulnerability Type: Unrestricted file write destination and unsafe overwrite behavior
Risk Level: MediumVulnerable Code
markdown Before anything else, the agent asks the user **explicitly** where to save the three files. The agent **does not** auto-pick a location. The agent **does not** proceed without an answer. The agent **does not** assume a default. The agent **does not** write any file until the user has answered with a path. - The user can give any path — relative, absolute, a new directory, or a name like `vpc/`. - If the user types `skip multi-file`, the agent writes only `vpc-result.md`. - If the user's path does not exist, the agent asks: *"The path [path] does not exist. Should I create it?"* The agent does not auto-create directories.The same file later introduces contradictory default behavior:
markdown ### Default path If the user does not specify a path in Step 0, the agent saves the three files to the **current working directory**. The user can override with any valid directory path.Technical Analysis
The Skill accepts any user-provided relative or absolute output path and directs the agent to write predictable filenames such as
vpc-result.mdandshadow-backlog.md. It does not require the agent to:- Canonicalize the requested path.
- Restrict output to the active project workspace.
- Reject
..path traversal. - Reject absolute paths outside an approved directory.
- Detect symbolic links.
- Check whether a destination file already exists.
- Obtain explicit confirmation before replacing an existing file.
- Use exclusive file creation or another atomic no-clobber mechanism.
Consequently, an attacker who controls the conversation can direct a filesystem-capable agent to a writable location outside the intended project. Predictable filenames also allow a pre-positioned sym ...[truncated 1646 chars]
- Remediation
View remediation
Remediation Suggestions
- Restrict output to the active workspace or an explicitly configured artifact root.
- Resolve the requested path to its canonical form and verify that it remains beneath the approved root.
- Reject traversal components and out-of-workspace absolute paths.
- Use
lstat-equivalent checks on the destination directory and files; reject symbolic links unless explicitly authorized. - Before every write, check whether the target already exists and show the exact canonical target to the user.
- Require explicit overwrite approval for each existing file, or generate a unique versioned filename.
- Use atomic writes with exclusive creation where available.
- Remove the contradictory current-working-directory fallback at line 480. Step 0 should either always require a path or clearly define one safe, workspace-confined default.
- Log the canonical destination and overwrite decision in the workshop record.
