T09 · Insecure Skill Coding Practices
- Location
home-music.sh:129- Finding
Arbitrary Command Execution Through Unvalidated Focus Volume
- Content
View full analysis
- Remediation
View remediation
100 )); then echo "Volume must be an integer from 0 to 100" >&2 return 2 fi local vol_float vol_float=$(awk -v value="$vol_pct" \ 'BEGIN { printf "%.2f", value / 100 }') # Remaining scene logic... } ``` Additional hardening measures: 1. Enforce the same 0–100 range in the Python API before invoking the script. 2. Restrict `run_scene()` to known scene names and validate scene-specific arguments. 3. Add tests covering semicolons, quotes, newlines, AWK expressions, negative values, decimals, and values above 100. 4. Preserve argument-array subprocess execution in Python and do not introduce `shell=True`. 5. Treat validation in the shell script as authoritative because it can be invoked independently of the Python wrapper. ]]>
