T08 · Insecure Dependencies
- Location
html_extract.py:26- Finding
Automatic Installation of Unpinned Dependencies into the Active Python Environment
- Content
View full analysis
None: """Install any required packages that are missing.""" missing = [ pip_name for module, pip_name in REQUIRED_PACKAGES.items() if importlib.util.find_spec(module) is None ] if not missing: return warn(f"Installing missing packages: {', '.join(missing)}...") try: subprocess.check_call( [sys.executable, "-m", "pip", "install", *missing, "--break-system-packages"] ) except subprocess.CalledProcessError: # --break-system-packages may not be supported (e.g. macOS, older pip). Retry without it. try: subprocess.check_call( [sys.executable, "-m", "pip", "install", *missing] ) except subprocess.CalledProcessError: warn(f"Failed to install: {', '.join(missing)}") sys.exit(1) ``` The installation function is automatically invoked at program startup: ```python if __name__ == "__main__": ensure_dependencies() main() ``` ### Technical Analysis The script checks whether `trafilatura` is importable and, if not, automatically invokes pip to install it. No package version or artifact hash is pinned. Consequently, the package version and its transitive dependency graph can change after the skill has been reviewed. Python package installation may execute package build hooks or other installation-time code. If the package index, named package, maintainer account, distribution artifact, or a transitive dependency is compromised, attacker-controlled code could execute with the same privileges as the skill process. The `--break-system-packages` option further weak ...[truncated 1649 chars]- Remediation
View remediation
