T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Runtime Dependencies Create Supply-Chain Exposure
- Content
View full analysis
=2.31 beautifulsoup4>=4.12 ``` The documented installation workflow executes: ```bash python3 -m pip install -r {baseDir}/requirements.txt ``` ### Technical Analysis The dependency declarations specify only minimum versions. They do not impose upper bounds, pin exact versions, verify package hashes, or use a reviewed lockfile. Consequently, each installation can resolve different future releases and transitive dependencies from the configured Python package index. The package names appear legitimate, and no dependency confusion or typosquatting was identified in the reviewed files. Nevertheless, the unconstrained resolution process delegates trust to all future compatible package releases and their transitive dependency trees. This exceeds the minimum supply-chain exposure necessary for a small, stable helper script. Python packages can execute code during installation and subsequently when imported. A compromised future release, compromised package-index account, malicious package-index mirror, or unexpected transitive dependency could therefore execute code with the privileges of the user running the installation or Skill. ### Attack Path 1. The Skill is invoked on a system where its dependencies are not installed. 2. The documented workflow runs `python3 -m pip install -r requirements.txt`. 3. The configured package index resolves the newest releases satisfying `requests>=2.31` and `beautifulsoup4>=4.12`, including their transitive dependencies. 4. A compromised or malicious compatible package release is downloaded because no exact version or hash is enforced. 5. Malicious package code runs during installation or when `search_papers.py` imports the package. 6. The code operates with the same filesystem, network, environment-variable, and proc ...[truncated 519 chars]- Remediation
View remediation
beautifulsoup4== ``` 2. Generate and commit a lockfile that includes all transitive dependencies. 3. Require cryptographic hashes during installation, such as through a hash-locked requirements file and `pip install --require-hashes`. 4. Use an explicitly trusted package index or an internally controlled package mirror. 5. Periodically update pinned versions through a controlled review and vulnerability-scanning process. 6. Install dependencies inside an unprivileged virtual environment rather than into a system-wide Python environment. ]]>
