T09 · Insecure Skill Coding Practices
- Location
assets/project-skeleton/run_local_macos.sh:29- Finding
Unrestricted Export Paths Allow Writes Outside the Project Directory
- Content
View full analysis
- Remediation
View remediation
Path: root = (Path(project_root) / "exports").resolve() candidate_name = Path(configured_path) if candidate_name.is_absolute() or ".." in candidate_name.parts: raise ValueError("Export path must be a safe relative path") candidate = (root / candidate_name.name).resolve() if candidate.parent != root: raise ValueError("Export path escapes the exports directory") if candidate.suffix.lower() != suffix: raise ValueError(f"Export path must end with {suffix}") return candidate ``` For stronger isolation, store only basename fields in the specification, such as `asset.glb`, and have the runtime always construct the directory itself. ]]>
