os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
# Open on macOS if sys.platform == "darwin": os.system(f'open "{filepath}"') except Exception as e: print(f"Download failed: {e}", file=sys.stderr)- Confidence
- 95% confidence
- Finding
- The code invokes a shell via os.system() to open the downloaded file on macOS. Even though the path is wrapped in quotes, shell execution is unnecessary here and can become dangerous if filepath contains shell-significant characters, and it also causes side effects by launching a local application automatically.
