T09 · Insecure Skill Coding Practices
- Location
SKILL.md:149- Finding
Attacker-Controlled Note Titles Can Escape the Configured Download Directory
- Content
View full analysis
- Remediation
View remediation
|\x00-\x1f]', '_', title).strip() safe_title = safe_title.replace("..", "_") if not safe_title: safe_title = note_id candidate = os.path.realpath(os.path.join(base_dir, safe_title)) if os.path.commonpath([base_dir, candidate]) != base_dir: raise ValueError("Unsafe note output path") note_dir = candidate os.makedirs(note_dir, exist_ok=True) ``` 5. Consider creating directories as `-` to provide uniqueness while retaining readability. 6. Apply the containment check immediately before every filesystem write as defense in depth. 7. Document that the destination should be a dedicated, non-sensitive download directory. ]]>
