T09 · Insecure Skill Coding Practices
- Location
scripts/batch_transcript.py:610- Finding
Remote Media Metadata Allows Output Path Traversal
- Content
View full analysis
- Remediation
View remediation
Path: base = base.resolve() candidate = (base / name).resolve() candidate.relative_to(base) return candidate ``` 3. Apply containment validation separately to collection directories, episode directories, and every generated file. 4. Prefer generated directory names based on trusted numeric indices and validated media IDs. Treat the human-readable title only as an optional sanitized suffix. 5. Avoid silently overwriting existing files. Use exclusive creation where practical, or explicitly verify that the destination is a regular file inside the approved output tree. 6. Add tests covering absolute paths, nested separators, `../` traversal, Windows separators, drive letters, Unicode separators, control characters, and symbolic links. ]]>
