subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
subprocess.run(cmd_mix, check=True) # Step 4: Encode final output (MP3/Original format) subprocess.run( ["ffmpeg", "-y", "-i", temp_wav_mix, output_path], check=True, stdout=subprocess.DEVNULL,- Confidence
- 82% confidence
- Finding
- The final ffmpeg call passes a user-influenced output_path directly to an external tool without validation. While Python is not invoking a shell, filenames beginning with '-' can be interpreted by ffmpeg as options rather than destinations, enabling argument/option injection behavior such as overwriting unintended files, changing codecs, or triggering unexpected network/protocol features depending on ffmpeg build and runtime behavior.
