T09 · Insecure Skill Coding Practices
- Location
scripts/humanize.sh:58- Finding
Path Traversal in Style Template Selection Permits Arbitrary Markdown File Reads
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 ;; esac TEMPLATE="$BASE_DIR/templates/$STYLE.md" ``` For defense in depth: 1. Reject values containing `/`, `\`, `..`, control characters, or leading dots. 2. Resolve the template and template-directory paths with `realpath`. 3. Verify that the resolved file starts with the canonical template-directory path. 4. Do not use file existence as a substitute for authorization. 5. Add regression tests covering absolute paths, traversal sequences, nested traversal, symbolic links, and unsupported style names. ]]>
