subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
with open(concat_list, "w", encoding="utf-8") as f: for pf in part_files: f.write(f"file '{os.path.basename(pf)}'\n") result = subprocess.run( ["ffmpeg", "-y", "-f", "concat", "-safe", "0", "-i", concat_list, "-c", "copy", output_file], capture_output=True, text=True, cwd=out_dir,- Confidence
- 84% confidence
- Finding
- Although shell injection is not present, this ffmpeg concat operation consumes a concat manifest containing unescaped filenames and explicitly enables '-safe 0'. If an attacker can influence output_file/out_dir or create crafted colliding filenames in that directory, ffmpeg may read unintended files or misparse entries, making the concat stage more dangerous than the other subprocess calls.
