subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
import subprocess pip_name = pip_name or name print(f"Installing {pip_name}...") subprocess.check_call([sys.executable, "-m", "pip", "install", pip_name]) __import__(name)- Confidence
- 96% confidence
- Finding
- This code automatically invokes pip at runtime to install a package whose name is provided as an argument, giving the skill package installation and command execution capability. If name or pip_name can be influenced by untrusted input, this can install a malicious package from the Python package index or other configured package sources, leading to arbitrary code execution during install or import.
