Scanned on 2/7/2026
Script has command injection vulnerabilities through unsanitized user inputs passed to ffmpeg and mkdir commands, allowing arbitrary command execution.
This script has critical security vulnerabilities despite some good practices. The main issues are: (1) The 'index' parameter is directly interpolated into an ffmpeg filter expression without validation, allowing command injection via shell metacharacters. (2) The 'time' parameter is passed unsanitized to ffmpeg's -ss flag. (3) The 'out' parameter can contain path traversal sequences or command injection attempts through the mkdir and ffmpeg commands. An attacker could exploit these by providing malicious inputs like: --index '0);$(malicious_command);echo $(' or --out '/tmp/file.jpg;malicious_command;'. While the script uses quotes around variables (good practice), it doesn't validate input format or content. The script also allows unrestricted filesystem access to read any video file and write anywhere. To be production-safe, all user inputs must be validated against strict patterns (regex for index as digits only, time as HH:MM:SS format, output path within allowed directories). The trust score of 45 reflects critical command injection risks that could lead to arbitrary code execution.
Command injection vulnerability in index parameter - user input is directly interpolated into ffmpeg filter without sanitization
Evidence:
-vf "select=eq(n\\,${index})"Command injection vulnerability in time parameter - unsanitized input passed to ffmpeg -ss flag
Evidence:
-ss "$time"Path traversal and command injection in out parameter - arbitrary paths can be created and used without validation
Evidence:
mkdir -p "$(dirname "$out")" and ffmpeg ... "$out"Unrestricted file system access - script can read any video file and write to any location the user has permissions for
Evidence:
if [[ ! -f "$in" ]]; then ... fi and mkdir -p "$(dirname "$out")"Arbitrary ffmpeg execution - while quoted, ffmpeg processes user-controlled file paths which could exploit ffmpeg vulnerabilities
Evidence:
ffmpeg ... -i "$in" ... "$out"