T09 · Insecure Skill Coding Practices
- Location
scripts/build_showcase.sh:10- Finding
FFmpeg Argument Injection Through Unquoted Input Construction
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi concat="" for ((j = 0; j < i; j++)); do concat+="[v$j]" done "$FFMPEG" "${inputs[@]}" \ -filter_complex "${filter} ${concat}concat=n=$i:v=1:a=0[out]" \ -map "[out]" -c:v libx264 -pix_fmt yuv420p -r "$FPS" -- "$OUTPUT" ``` Additional hardening measures: 1. Resolve `FFMPEG` to an approved executable path or reject values containing whitespace instead of accepting an arbitrary command-like string. 2. Treat screenshot directories and filenames as untrusted input. 3. Run FFmpeg in a sandbox with minimal filesystem permissions and no network access when processing untrusted media. 4. Restrict FFmpeg protocols where supported, allowing only those required for local image processing. 5. Validate that each discovered input is a regular local file and an expected image type before invoking FFmpeg. 6. Fail explicitly when no PNG files are found rather than generating a malformed filter graph. 7. Add regression tests using filenames containing spaces, wildcard chara ...[truncated 102 chars]
