T09 · Insecure Skill Coding Practices
- Location
SKILL.md:41- Finding
Command Injection Through Unescaped Custom Reminder Text
- Content
View full analysis
- Remediation
View remediation
shell: false ``` 2. **Validate duration separately** - Parse duration as structured data rather than concatenating it into a command. - Accept only the documented forms: seconds, minutes, hours, plain numeric minutes, `MM:SS`, and `HH:MM:SS`. - Reject negative, malformed, excessively large, or trailing values. 3. **Treat reminder text only as data** - Pass reminder text as one argument without evaluating or reparsing it. - Apply a reasonable length limit and reject control characters where they are unnecessary. - Do not rely solely on quote replacement as a substitute for shell-free execution. 4. **Constrain the script path** - Resolve `{baseDir}/timer.js` from a trusted, fixed base directory. - Do not permit user input to influence the executable or script path. 5. **Apply least privilege** - Run timer processes under a restricted account or sandbox. - Limit filesystem access, environment-variable exposure, child-process creation, and network access to what the timer requires. 6. **Add security tests** - Test reminder values containing single and double quotes, semicolons, command substitutions, backticks, pipes, redirections, newlines, and platform-specific shell metacharacters. - Verify that each value arrives at the timer script as one literal argument and never causes an additional process to execute. 7. **Package the referenced implementation** - Include the referenced `timer.js` file so its behavior and input handling can be reviewed. - Document the exact safe execution API rath ...[truncated 61 chars]
