T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Third-Party Dependencies and Mutable Container Images## Vulnerability Details **File Location**: `requirements.txt:1-4`; `README.md:40-41`; `SKILL.md:196-202, 215-219, 455-472` **Vulnerability Type**: Supply-chain exposure through unpinned dependencies and mutable artifacts **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1-4`: ```text # Core dependencies requests>=2.28.0 numpy>=1.20.0 pyyaml>=6.0 ``` `README.md:40-41`: ```bash # 1. Install dependencies pip3 install aiohttp pyyaml ``` Relevant installation commands in `SKILL.md` include: ```bash pip install -r requirements.txt docker pull pengong101/searxng-auto-proxy:latest pip install searxng-auto-proxy ``` ### Technical Analysis The dependency file permits any version at or above the specified minimum. It does not provide exact versions, integrity hashes, or a lock file. In addition, `adapter.py` imports `aiohttp`, but `aiohttp` is absent from `requirements.txt`. The documentation instead instructs users to install it directly without a version constraint. The Skill documentation also recommends pulling a personal container image using the mutable `latest` tag. Consequently, the executable artifact received by a user can change after this audited package has been reviewed. This does not prove that any current dependency or container is malicious. However, it creates a supply-chain execution path through compromised publisher accounts, malicious future releases, dependency takeover, or incompatible upstream updates. ### Attack Path 1. An attacker compromises an upstream package publisher, package registry account, or container registry account. 2. The attacker publishes a malicious version satisfying a broad requirement such as `pyyaml>=6.0`, or replaces the image referenced by the `latest` tag. 3. A user follows the documented `pip install` or `docker pull` instructions. 4. The package installation process or downloaded container executes attacker-controlled code. 5. The ma ...[truncated 755 chars]
- Remediation
- ## Remediation Suggestions 1. Add every runtime dependency, including `aiohttp`, to a single authoritative dependency file. 2. Pin dependencies to exact audited versions rather than minimum versions. 3. Generate and verify cryptographic hashes, for example with `pip-compile --generate-hashes`, and install with `pip --require-hashes`. 4. Maintain a reproducible lock file and update it through a reviewed dependency-upgrade process. 5. Pin container images by immutable digest, such as `image@sha256:...`, instead of using `latest`. 6. Verify the ownership and provenance of PyPI and container registry artifacts. 7. Run dependency vulnerability and software-bill-of-materials scans in CI. 8. Install into an isolated virtual environment and run the adapter as a dedicated unprivileged user. 9. Avoid presenting unaudited remote packages or images as interchangeable with the bundled source.
