T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Shell Command Injection Through Unsafely Interpolated Metadata and File Paths
- Content
View full analysis
- Remediation
View remediation
` - `-overwrite_original` - `--` - `` 3. Use `shell=false` or the equivalent setting in the implementation environment. 4. If Bash is unavoidable, apply a proven shell-escaping function to every dynamic value. Do not rely on manually adding double quotes. 5. Canonicalize and validate paths before execution. Restrict operations to explicitly authorized directories where practical. 6. Insert `--` before user-controlled paths to prevent pathnames beginning with a hyphen from being treated as options. 7. Avoid embedding wildcards in user-controlled shell strings. Enumerate matching files through a safe filesystem API and pass each path as a separate argument. 8. Require explicit user confirmation before recursive operations or bulk modification. 9. Consider removing `-overwrite_original` by default or creating an independent backup before destructive metadata changes. 10. After modification, verify the resulting metadata using a separate safely parameterized read operation. ]]>
