T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Dependency Installation Creates Supply-Chain Exposure## Vulnerability Details **File Location**: `requirements.txt:1`, `setup.sh:21-32` **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```text requests>=2.28.0 ``` ```bash # Install dependencies into scripts/vendor/ (works with any system python3) VENDOR_DIR="$SKILL_DIR/scripts/vendor" echo "Installing dependencies into scripts/vendor/..." python3 -m pip install -q --target "$VENDOR_DIR" -r "$SKILL_DIR/requirements.txt" # Also install into venv as fallback if [ ! -d "$VENV_DIR" ]; then echo "Creating virtual environment..." python3 -m venv "$VENV_DIR" else echo "Virtual environment already exists." fi "$VENV_DIR/bin/pip" install -q -r "$SKILL_DIR/requirements.txt" ``` ### Technical Analysis The dependency specification permits any future version of `requests` equal to or newer than 2.28.0. Its transitive dependencies are also resolved dynamically. No lock file, exact version constraints, package hashes, or trusted package repository configuration is present. Consequently, the code installed by `setup.sh` is not the same fixed dependency set that was available during this audit. The setup process installs the mutable dependency tree twice: once into `scripts/vendor/` and once into the virtual environment. Python package installation and later imports can execute package-controlled code. This is a supply-chain hardening weakness rather than evidence that the currently named `requests` package is malicious. ### Attack Path 1. An attacker compromises a permitted future package release, a transitive dependency, or the package delivery channel. 2. The user or agent runs `bash setup.sh`. 3. Pip resolves the newest package versions satisfying `requests>=2.28.0`. 4. The compromised package is installed into `scripts/vendor/` and `.venv`. 5. Package-controlled code executes during installation or when imported by the provide ...[truncated 565 chars]
- Remediation
- ## Remediation Suggestions 1. Replace range-based requirements with reviewed, exact versions for direct and transitive dependencies. 2. Generate a reproducible lock file using a tool such as `pip-tools`. 3. Record and enforce package hashes: ```bash pip install --require-hashes -r requirements.lock ``` 4. Configure pip to use an explicitly trusted package index. 5. Add automated dependency vulnerability and integrity scanning. 6. Avoid installing the same dependencies into two locations unless both are required. 7. Review and deliberately update the lock file rather than resolving arbitrary future releases during setup.
