subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = [sys.executable, "-m", "pip", "install", "-r", str(req_file)] else: cmd = [sys.executable, "-m", "pip", "install", "scikit-learn"] result = subprocess.run(cmd, capture_output=True, text=True) if result.returncode == 0: print(" ✓ Dependencies installed!") print()- Confidence
- 93% confidence
- Finding
- The script can invoke pip at runtime to install packages, which is beyond the core purpose of scoring/submitting a profile and introduces software supply chain risk. Even though the command is not shell-injected and uses a fixed argv list, it still executes code acquisition from external package sources and may install dependencies from a repository-controlled requirements file.
