subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
f.write(f"file '{tf}'\n") if audio_format == 'mp3': subprocess.run( ['ffmpeg', '-y', '-f', 'concat', '-safe', '0', '-i', concat_file, '-codec:a', 'libmp3lame', '-q:a', '2', final_path], check=True, capture_output=True- Confidence
- 86% confidence
- Finding
- The code invokes ffmpeg on a concat file built from generated temporary filenames while using ffmpeg's concat demuxer with '-safe 0'. Although subprocess.run is used without a shell, the concat input format is still interpreter-controlled by file contents, so malformed or specially crafted paths can cause ffmpeg to read unintended files or behave unexpectedly during merging.
