T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:4
- Finding
- Unpinned and Unverified Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:4-7`; installation instruction at `README.md:51-60` **Vulnerability Type**: Dependency supply-chain integrity weakness **Risk Level**: Medium ### Vulnerable Code `requirements.txt:4-7`: ```text pandas>=2.2,<3.0 numpy>=1.26,<3.0 matplotlib>=3.8,<4.0 seaborn>=0.13,<1.0 ``` `README.md:51-60`: ```markdown 2. **Install dependencies**: ```bash pip install -r requirements.txt ``` 3. **Run analysis**: ```bash python openclaw_adapter.py \ ``` ### Technical Analysis The documented installation procedure directs users to install dependencies from the configured Python package index. The requirements specify broad version ranges rather than exact, reviewed versions and do not provide cryptographic hashes. Consequently, two installations at different times can resolve to different package artifacts. If an allowed future package release, dependency of one of these packages, configured package index, or package-distribution account is compromised, the installation may retrieve attacker-controlled code that was not included in this audit. Python packages can execute code during installation or when imported. This project imports these dependencies during figure generation, so a malicious resolved artifact could also execute when an analysis requests visualizations. This finding does not demonstrate that the currently named packages are malicious. It identifies the absence of controls needed to ensure that users install the same reviewed artifacts. ### Attack Path 1. An attacker compromises the publishing account, distribution artifact, transitive dependency, or package index associated with a dependency permitted by the declared version ranges. 2. The attacker publishes a malicious release whose version remains within the accepted range. 3. A user follows the documented `pip install -r requirements.txt` procedure. 4. The resolver selects and downloads the malicious artifact becau ...[truncated 961 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace broad dependency ranges with exact versions selected after review: ```text pandas==<reviewed-version> numpy==<reviewed-version> matplotlib==<reviewed-version> seaborn==<reviewed-version> ``` 2. Generate a lock file containing all transitive dependencies rather than locking only direct dependencies. 3. Record SHA-256 hashes for every permitted distribution and require hash verification during installation: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Generate lock files separately for each supported Python version and platform where artifact hashes differ. 5. Use a trusted, explicitly configured package index or an internally controlled artifact mirror. Prevent fallback to untrusted indexes. 6. Add automated dependency vulnerability and provenance checks to the release process. Review all lock-file changes before publication. 7. Preserve the current version ranges only in a human-maintained source dependency file, if desired, while distributing and documenting installation from the fully pinned, hash-verified lock file. 8. Document that figure generation is optional and provide a standard-library-only execution path for environments that do not require plots, reducing unnecessary supply-chain exposure. ]]>
