T09 · Insecure Skill Coding Practices
- Location
SKILL.md:119- Finding
Shell Command Injection Through Unsanitized Video Titles and URLs
- Content
View full analysis
/<视频标题>.source.mp4" \ -vf "subtitles='<视频标题>/<视频标题>.srt'" \ -c:v libx264 -crf 20 -preset medium \ -c:a copy \ "<视频标题>/<视频标题>.mp4" ``` Related URL interpolation: ```bash yt-dlp --dump-single-json "" ``` Related title-derived output paths: ```bash yt-dlp \ -f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[height<=1080][ext=mp4]/best[height<=1080]" \ --merge-output-format mp4 \ -o "%(title)s/%(title)s.source.%(ext)s" \ "" ``` ```bash yt-dlp \ --skip-download \ --write-thumbnail \ --convert-thumbnails jpg \ -o "%(title)s/%(title)s.%(ext)s" \ "" ``` ```bash yt-dlp \ --skip-download \ --write-sub \ --write-auto-sub \ --sub-langs "zh-Hans,zh-CN,zh,zh-TW,*" \ --sub-format "srt/best" \ -o "%(title)s/%(title)s.%(ext)s" \ "" ``` ### Technical Analysis The skill directs the agent to insert a user-provided YouTube URL and a remotely supplied video title directly into shell command templates. The video title is subsequently used in FFmpeg input paths, output paths, and a `subtitles` filter expression. If the agent constructs a command as text and replaces the placeholders before passing it to a shell, shell metacharacters embedded in a URL or video title may become executable syntax. Double quotes prevent ordinary word splitting but do not neutralize shell constructs already present in the generated command, including command substitution expressions such as `$(...)` and backticks. The FFmpeg filter argument additionally has its own escaping rules, creating further opportunities for filter-expression injection or command failur ...[truncated 1950 chars]- Remediation
View remediation
