subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd.extend(["-c", cfg]) print(f"🔧 执行命令: {' '.join(cmd)}") result = subprocess.run(cmd, capture_output=True, text=True, timeout=30) if result.returncode != 0: print(f"⚠️ mmdc 命令执行失败: {result.stderr}")- Confidence
- 95% confidence
- Finding
- The code executes an external program via subprocess.run, and the executable path can be influenced by MMDCCMD from the environment or by PATH resolution. Although shell=True is not used, this still permits execution of an attacker-controlled binary if the runtime environment is manipulated, which is dangerous in agent or plugin deployments where environment variables may be user-influenced or weakly isolated.
