T09 · Insecure Skill Coding Practices
- Location
scripts/eval.py:328- Finding
Auto-Fix Follows an Unvalidated SKILL.md Symbolic Link
- Content
View full analysis
/SKILL.md`. It verifies only that the path exists. It does not verify that `SKILL.md` is a regular file, reject symbolic links, canonicalize the path, or confirm that the resolved file remains inside the resolved skill directory. Python operations including `Path.exists()`, `Path.read_text()`, `Path.write_text()`, and the `shutil.copy()` operation used by `create_backup()` follow symbolic links. Consequently, when auto-fix runs with `--allow-write`, a crafted `SKILL.md` symbolic link can redirect the write operation to another file writable by the invoking account. Exploitation requires the linked file's contents and detected anti-patterns to produce an applicable fix. For example, a Markdown-like target containing a heading but no trigger phrase can be modified by `fix_missing_trigger()`. The explicit `--allow-write` requirement reduces accidental exposure but does not make an attacker-controlled skill directory safe to process. ### Attack Path 1. An attacker prepares a skill directory under their control. 2. The attacker creates `SKILL.md` as a symbolic link to a file writable by the user who will run the evaluator. 3. The linked target contains content that triggers an auto-fix, such as a Markdown heading w ...[truncated 1308 chars]- Remediation
View remediation
