T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:24- Finding
Command Injection Through Bash Arithmetic Evaluation of --index
- Content
View full analysis
- Remediation
View remediation
&2 exit 2 fi index="$2" ``` Additional hardening should include: - Reject unknown options instead of silently shifting past them. - Reject a missing value after `--index`. - Avoid evaluating untrusted strings in shell arithmetic. - Perform arithmetic only after strict regular-expression and range validation. - Add negative tests using malformed values, arithmetic expressions, array subscripts, and command substitutions. ]]>
