subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = ["xdg-open", web_url] try: result = subprocess.run(cmd, capture_output=True, text=True, timeout=5) except (FileNotFoundError, subprocess.TimeoutExpired) as exc: logger.debug("Could not auto-open browser for web viewer: %s", exc) return False, str(exc)- Confidence
- 82% confidence
- Finding
- The code launches a local browser helper with a URL derived from discussion creation results, without validating the scheme or destination. Even though subprocess.run is invoked without a shell, opening attacker-influenced URLs can still trigger unsafe handlers, local application launches, or user redirection if web_url can be influenced by untrusted input elsewhere in the stack.
