T09 · Insecure Skill Coding Practices
- Location
scripts/init_project.py:8- Finding
Unvalidated Project Name Enables Path Traversal
- Content
View full analysis
- Remediation
View remediation
Path: if not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", name): raise ValueError("Invalid project name") destination = (PROJECT_ROOT / name).resolve() if not destination.is_relative_to(PROJECT_ROOT): raise ValueError("Project path escapes the permitted root") return destination ``` File creation should then use the validated `destination` and should reject unexpected symlinks where the runtime and threat model require stronger protection. ]]>
