subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 使用 agent-browser 打开百度百科 cmd = f'agent-browser open "{song_url}"' result = subprocess.run(cmd, shell=True, capture_output=True, text=True) print(f"Result: {result.stdout}") # 等待页面加载- Confidence
- 94% confidence
- Finding
- This call builds a shell command string and executes it with shell=True while interpolating a URL. Even though the current song list is hardcoded, this pattern is dangerous because any future change that makes song_url configurable would permit command injection, and the browser tool is being invoked to perform external network actions.
