subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Open in browser open_cmd = f'browser open --url "{file_url}"' result = subprocess.run(open_cmd, shell=True, capture_output=True, text=True) if result.returncode != 0: print(f"❌ Failed to open browser: {result.stderr}")- Confidence
- 97% confidence
- Finding
- This command is built with attacker-influenced input (`html_path` via `file_url`) and executed with `shell=True`, which enables shell metacharacter injection if the path contains characters such as quotes or command separators. In this skill context, the script is explicitly designed to open local files in a browser tool, so untrusted path input can lead to arbitrary command execution under the agent's privileges.
