subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 执行命令 # 执行命令 if sys.platform == "win32": result = subprocess.run(cmd, capture_output=True, text=True, timeout=30, shell=True) else: result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)- Confidence
- 98% confidence
- Finding
- On Windows, the renderer invokes Mermaid CLI with shell=True while assembling arguments that include user-influenced values such as output path and theme. Using a shell for command execution substantially increases command-injection risk if quoting/escaping is mishandled by the platform or future code changes introduce string-based command construction.
