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
- 97% confidence
- Finding
- On Windows, the code invokes 'start' with shell=True while passing a variable path. Because shell=True causes command-line interpretation by the shell, a crafted filename or path containing shell metacharacters could trigger unintended command execution instead of merely opening the PPT file.
