T08 · Insecure Dependencies
Warning
- Location
- README.md:92
- Finding
- Unpinned Third-Party Dependencies Permit Supply-Chain Code Execution## Vulnerability Details **File Location**: `README.md:92-96` **Additional Locations**: `requirements.txt:1-3`, `docs/AUTOTRADER_INTEGRATION.md:30-32`, `docs/AUTOTRADER_INTEGRATION.md:340-343`, `docs/AUTOTRADER_INTEGRATION.md:362-371`, `docs/AUTOTRADER_INTEGRATION.md:427-428` **Vulnerability Type**: Unpinned and unverifiable third-party package installation **Risk Level**: Medium ### Vulnerable Code `README.md:92-96`: ```bash # Install basic dependencies first pip install -r ~/.cursor/skills/uk-car-recommender/requirements.txt # Add AutoTrader support pip install autotrader_scraper ``` `requirements.txt:1-3`: ```text requests>=2.31.0 beautifulsoup4>=4.12.0 lxml>=5.0.0 ``` The same unpinned `pip install autotrader_scraper` instruction is repeated in `docs/AUTOTRADER_INTEGRATION.md`. ### Technical Analysis The project recommends installing `autotrader_scraper` directly from the package index without an exact version, integrity hash, lockfile, or package-provenance verification. The primary dependencies likewise use lower-bound-only constraints, allowing future releases outside the audited dependency set to be installed. Python package installation may execute package-controlled build backends and installation logic. Therefore, the code ultimately executed during installation can change after this project has been reviewed. If the package publisher account or distribution infrastructure is compromised, or if package ownership changes, following the documented command could install and execute attacker-controlled code. This finding does not establish that the current `autotrader_scraper` package is malicious. The vulnerability is the absence of controls ensuring that users receive the specific dependency artifacts reviewed and tested by the project. ### Attack Path 1. An attacker compromises the publisher account or release pipeline for `autotrader_scraper`, takes control of the package name, ...[truncated 1863 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every production dependency to an exact, reviewed version: ```text requests==<reviewed-version> beautifulsoup4==<reviewed-version> lxml==<reviewed-version> autotrader_scraper==<reviewed-version> ``` 2. Generate and commit a hash-locked requirements file containing hashes for every direct and transitive dependency. Install it using: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Replace every documented `pip install autotrader_scraper` command with installation from the reviewed lockfile. Keep README and integration documentation consistent. 4. Verify the package's publisher, repository, release provenance, and source-to-wheel correspondence before approving a version. Record the reviewed version and artifact hashes. 5. Use a controlled internal package mirror or artifact registry that only contains approved artifacts. Disable unexpected fallback to public indexes where practical. 6. Run dependency installation in an isolated virtual environment or container under a non-privileged account. Do not install the package with administrator or root privileges. 7. Add automated dependency review, vulnerability scanning, and controlled update pull requests. Require security review and test execution before changing locked versions. 8. If the optional package cannot be reliably verified, remove the installation recommendation and retain the local fallback implementation, or vendor a reviewed implementation while maintaining an explicit update process.
