subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
elif system == "Linux": subprocess.run(["xdg-open", path], check=True, capture_output=True) elif system == "Windows": subprocess.run(["start", "", path], check=True, shell=True, capture_output=True) except subprocess.CalledProcessError: pass- Confidence
- 96% confidence
- Finding
- On Windows, this branch uses shell=True while passing a path value that ultimately derives from remote content and local file naming. Using the shell to invoke start increases the risk of command interpretation or argument confusion on Windows, which can enable command injection or unexpected execution if the path or environment is manipulated.
