T09 · Insecure Skill Coding Practices
- Location
scripts/init_skill.py:194- Finding
Skill Name Path Traversal Allows Writes Outside the Requested Destination
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly a coherent skill-authoring helper, but its bundled scripts have filesystem containment gaps that users should review before installation.
Install only if you are comfortable with a skill that can create local skill folders and package archives. Use trusted skill names and trusted source directories, avoid packaging untrusted skill trees or trees containing symlinks, and review generated archive contents before sharing.
scripts/init_skill.py:194Skill Name Path Traversal Allows Writes Outside the Requested Destination
scripts/package_skill.py:69Skill Packaging Follows File Symlinks and Can Disclose Files Outside the Skill Root
The declared purpose describes an instructional or guidance-oriented skill for creating or updating skills. The supplied code does not provide guidance content or creation workflows; instead, it is an operational packaging utility that validates an existing skill folder and produces a distributable .skill file. This is a materially different primary purpose. The filesystem reads/writes and archive creation are also undeclared capabilities relative to the description.
The declared description says this skill is a guide for creating or updating skills. The supplied code instead implements a quick validator that reads files from disk and validates SKILL.md frontmatter and formatting rules. While validation could be tangentially related to skill creation, the primary behavior here is automated linting/verification, not guidance or workflow support for authoring skills. No dangerous extra permissions are present, but the core function is materially different from the declared purpose.
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.
1. Understand the skill with concrete examples
2. Plan reusable skill contents (scripts, references, assets)
3. Initialize the skill (run init_skill.py)
4. Edit the skill (implement resources and write SKILL.md)
5. Package the skill (run package_skill.py)
6. Iterate based on real usage
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.
Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
#### Update SKILL.md
**Writing Guidelines:** Always use imperative/infinitive form.
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.
# Print next steps
print(f"\n✅ Skill '{skill_name}' initialized successfully at {skill_dir}")
print("\nNext steps:")
print("1. Edit SKILL.md to complete the TODO items and update the description")
print("2. Customize or delete the example files in scripts/, references/, and assets/")
print("3. Run the validator when ready to check the skill structure")
Without declared permissions the skill's intent is opaque and cannot be validated.
The description says the skill should be used when users want to create a new skill or update an existing skill, which is expansive and lacks negative examples or scope constraints. Because frontmatter description is the primary trigger, this broad phrasing could cause unintended invocation for loosely related conversations about capabilities or workflow design.
The skill instructs the agent to run initialization scripts that create directories and example files, but it does not require user confirmation or clearly warn about filesystem modification. In an agentic environment, this can lead to unexpected writes, clutter, overwriting of nearby files, or execution of local scripts without the user's informed consent.
The packaging workflow creates distributable archives and may write artifacts to default or user-specified locations, but the skill gives no user-facing warning about outputs, overwrites, or disk effects. This can cause accidental artifact creation, confusion about where files were written, or unintended disclosure if packaged content is later shared.
The usage text states that skill names must be lowercase, hyphen-case, limited to 40 characters, and match the directory name exactly. However, after reading argv, the code passes the provided skill name directly into path construction and file generation without any validation, so the documented restrictions are not actually implemented.