subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_cmd(cmd, timeout=120): """运行命令,返回 (ok, stdout)""" try: r = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=timeout) return r.returncode == 0, r.stdout.strip() except subprocess.TimeoutExpired: return False, "Timeout"- Confidence
- 98% confidence
- Finding
- The helper executes arbitrary shell strings with shell=True, and later callers build those strings from user-influenced values such as topic, script text, overlay text, subtitles path, and output paths. This creates a straightforward command injection surface where crafted input containing shell metacharacters can execute arbitrary OS commands during ffmpeg invocation.
