T09 · Insecure Skill Coding Practices
- Location
scripts/analyze.sh:518- Finding
Command Injection Through Unvalidated Arithmetic Threshold
- Content
View full analysis
- Remediation
View remediation
100 )); then echo "Error: quality threshold must be an integer from 0 to 100." >&2 exit 1 fi QUALITY_THRESHOLD=$((10#$QUALITY_THRESHOLD)) ``` Apply equivalent strict validation to other numeric inputs, particularly `DAYS` and `TOP_N`, with appropriate upper bounds to prevent malformed arguments and resource-exhaustion behavior. Do not pass untrusted strings directly into arithmetic contexts. Normalize validated values once and use only the normalized integer afterward. Add regression tests for nonnumeric values, arithmetic operators, variable references, array expressions, command substitutions, negative numbers, leading zeros, and values outside `0–100`. ]]>
