Tainted flow: 'cmd' from os.getenv (line 268, credential/environment) → subprocess.run (code execution)
Medium
- Category
- Data Flow
- Content
def get_video_duration(video_path: str) -> float: cmd = [FFPROBE, "-v", "error", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", video_path] r = subprocess.run(cmd, capture_output=True, text=True) return float(r.stdout.strip()) if r.returncode == 0 else 0- Confidence
- 87% confidence
- Finding
- The executable path for FFPROBE is sourced from environment variables or PATH and then executed. In environments where attackers can influence .env, process environment, or PATH resolution, this can lead to execution of a malicious binary with the script's privileges.
