T09 · Insecure Skill Coding Practices
- Location
install.sh:8- Finding
Unsanitized installation paths enable persistent shell command injection
- Content
View full analysis
- Remediation
View remediation
config ``` 3. **Validate path input.** Reject control characters and newlines, require absolute paths where appropriate, and enforce an explicit policy for allowed characters and locations. 4. **If `sed` remains necessary, escape values separately for the replacement context.** At minimum, escape backslashes, ampersands, and the selected delimiter. This is less robust than separating code from configuration and does not replace shell-safe serialization. 5. **Validate generated scripts before use.** Run `bash -n` on every generated or modified shell script and abort installation if validation fails. 6. **Apply least privilege.** Recommend installation and cron execution under a dedicated unprivileged account with read-only access to the required session directory and write access only to the selected vault and tracking directories. Replace root-oriented defaults with user-scoped paths. 7. **Harden scheduled execution.** Use absolute paths, a restricted `PATH`, restrictive file permissions, and verify that the script and configuration are owned by the scheduling user and are not writable by other accounts. ]]>
