T09 · Insecure Skill Coding Practices
- Location
scripts/reliable_click.sh:27- Finding
Command Execution Through Unvalidated Bash Arithmetic Expressions
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi ``` Apply the same validation to `WIN_X` and `WIN_Y` after parsing `xdotool` output: ```bash if ! is_integer "$WIN_X" || ! is_integer "$WIN_Y"; then echo "Error: Invalid window geometry" >&2 exit 1 fi ``` Additional hardening should include: 1. Require exactly one argument after `--window` and reject a missing value. 2. Reject unexpected trailing positional arguments. 3. Add reasonable coordinate bounds based on the active screen or target-window geometry. 4. Use `printf '%d'` only after strict validation; formatting alone should not replace validation. 5. Add regression tests using nonnumeric values, arithmetic operators, variable names, array syntax, and command-substitution-like input. ]]>
