subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run(cmd, cwd=None, capture=True): """执行shell命令,返回 (success, stdout, stderr)""" try: result = subprocess.run( cmd, shell=True, cwd=cwd or REPO_ROOT, capture_output=capture, text=True, timeout=60 )- Confidence
- 95% confidence
- Finding
- The helper executes shell commands with shell=True, which makes any interpolated string content subject to shell parsing and command injection. In this script, several commands are dynamically constructed using embedded JavaScript snippets, so a malformed path, quote, or future user-controlled input could lead to unintended command execution.
