subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def _run_cmd(cmd: str): log(f" $ {cmd}") subprocess.run(cmd, shell=True, check=True) def _get_duration(file: str) -> float:- Confidence
- 98% confidence
- Finding
- The helper `_run_cmd` executes arbitrary command strings with `shell=True`, and those strings are built from file names and runtime parameters elsewhere in the pipeline. Because `video/` and `audio/` filenames are incorporated into ffmpeg concat lists and command strings without robust escaping, a crafted filename containing quotes or shell metacharacters could break command boundaries and trigger command injection.
