subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
with open(concat_list, 'w') as f: for w in wavs: f.write(f"file '{w}'\n") subprocess.run(["ffmpeg", "-f", "concat", "-safe", "0", "-i", concat_list, "-c", "copy", args.out], check=True) print(f"Output: {args.out}") finally: for w in wavs:- Confidence
- 85% confidence
- Finding
- The ffmpeg concat call is fed by a list file whose paths are written with no escaping, while ffmpeg is explicitly run with -safe 0, disabling path safety checks. In this specific code, the listed files come from local temp names, so immediate exploitability is limited, but the pattern becomes dangerous if any path in the concat list can be influenced or if this code is modified to include user-controlled files, enabling unintended file access or processing of arbitrary paths.
