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 quoted, shell execution is unnecessary here and creates avoidable command-invocation risk if path handling changes or quoting is bypassed; it also performs a local side effect beyond simple task management.
