subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return str(path) print("Installing yt-dlp...") subprocess.check_call([sys.executable, "-m", "pip", "install", "yt-dlp"]) return shutil.which("yt-dlp") def extract(self, url, lang="en", auto_generate=True):- Confidence
- 95% confidence
- Finding
- The code automatically installs and executes yt-dlp via pip if it is not already present. This introduces an unexpected package installation and code execution path at runtime, which expands the trust boundary to PyPI, pip configuration, and the local Python environment; in restricted or agent contexts this is a meaningful supply-chain and arbitrary-code-execution risk.
