os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
from google.auth.transport.requests import Request except ImportError: print("Installing required packages...") os.system(f"{sys.executable} -m pip install google-auth-oauthlib google-auth-httplib2 google-api-python-client -q") from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request- Confidence
- 94% confidence
- Finding
- The script executes a shell command to install packages at runtime using os.system(). Even though the package names are hardcoded, invoking a shell introduces unnecessary command-execution risk and performs an unexpected side effect for an authentication helper; if the environment, interpreter path, or package index configuration is compromised, this can lead to arbitrary code execution via malicious package installation.
