subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
except ImportError: print("Installing yfinance...") import subprocess subprocess.check_call([sys.executable, "-m", "pip", "install", "yfinance", "-q"]) import yfinance as yf # 用户持仓:只有 BMI 和 PDD- Confidence
- 93% confidence
- Finding
- The script executes a subprocess to install a package at runtime, which introduces supply-chain and environment-integrity risk. Even though the command is not user-controlled, automatically invoking pip can pull unpinned code from external sources, modify the runtime unexpectedly, and violate least-privilege expectations for a simple reporting skill.
