T09 · Insecure Skill Coding Practices
Warning
- Location
scripts/tts-local.sh:29- Finding
Argument Injection Through Unquoted Speaker Parameter Expansion
- Content
View full analysis
- Remediation
View remediation
&2 usage } OUTPUT="$2" shift 2 ;; -s|--speaker) [[ $# -ge 2 ]] || { echo "Error: $1 requires a value." >&2 usage } SPEAKER_ARGS=(--tts-speaker-file "$2") shift 2 ;; -t|--temp) [[ $# -ge 2 ]] || { echo "Error: $1 requires a value." >&2 usage } TEMP="$2" shift 2 ;; -h|--help) usage ;; --) shift TEXT="$*" break ;; -*) echo "Error: unknown option: $1" >&2 usage ;; *) TEXT="$1" shift ;; esac done llama-tts \ -m "$MODEL" \ -mv "$VOCODER" \ -p "$TEXT" \ -o "$OUTPUT" \ --temp "$TEMP" \ --repeat-penalty "$REP_PENALTY" \ --repeat-last-n "$REP_LAST_N" \ --top-k "$TOP_K" \ --top-p "$TOP_P" \ --min-p "$MIN_P" \ "${SPEAKER_ARGS[@]}" ``` Additionally: - Validate that the speaker file exists, is a regular file, and is readable. - Validate output paths according to the intended trust boundary. - Validate temperature as a numeric value within the supported range. - Reject unknown options rather than treating them as text. - Use `set -euo pipefail` where compatible to make parsing and execution failures explicit. ]]>
