T09 · Insecure Skill Coding Practices
- Location
scripts/generate_video.sh:67- Finding
Command Injection Through Unvalidated Numeric Polling Parameters
- Content
View full analysis
- Remediation
View remediation
3600 )); then echo "Error: --poll-interval must be an integer between 1 and 3600" exit 1 fi if [[ ! "$TIMEOUT" =~ ^[0-9]+$ ]] || (( 10#$TIMEOUT < 1 || 10#$TIMEOUT > 86400 )); then echo "Error: --timeout must be an integer between 1 and 86400" exit 1 fi POLL_INTERVAL=$((10#$POLL_INTERVAL)) TIMEOUT=$((10#$TIMEOUT)) ``` Additional hardening should include: - Reject missing option values before accessing `$2`. - Apply strict allowlists to all enumerated parameters. - Avoid evaluating untrusted strings in arithmetic, conditional, or indirect-variable contexts. - Add negative tests containing arithmetic syntax, command substitutions, array expressions, whitespace, signs, and non-decimal prefixes. ]]>
