T08 · Insecure Dependencies
Warning
- Location
- install.sh:30
- Finding
- Unpinned and Unverified Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:30-31`, `requirements.txt:1-4` **Vulnerability Type**: Supply-chain exposure through mutable dependency resolution **Risk Level**: Medium ### Vulnerable Code ```bash # install.sh:30-31 echo "Installing Python dependencies..." pip install -r "$SCRIPT_DIR/requirements.txt" ``` ```text # requirements.txt:1-4 ollama>=0.4,<1.0 websockets>=14.0,<15.0 python-dotenv>=1.0,<2.0 httpx>=0.27,<1.0 ``` ### Technical Analysis The installer resolves dependencies from broad version ranges without exact version pins, package hashes, or a reviewed lock file. Consequently, the code installed on a future invocation may differ from the code that was available during this audit. Python package installation may execute package-controlled build or installation logic. If a dependency publisher account, package release, package index, or software distribution path is compromised, a malicious version satisfying one of these ranges could be selected and installed. The installation command also targets the currently active Python environment instead of creating a dedicated virtual environment, increasing the scope of any dependency conflict or compromise. The package names do not show evidence of typosquatting or dependency confusion in the audited files. The issue is the absence of reproducible, integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises an allowed dependency release, its publisher account, or the package distribution path. 2. The attacker publishes a malicious version that remains within a configured version range. 3. A user runs `bash install.sh`. 4. `pip` resolves the new mutable version because no exact version or cryptographic hash is required. 5. Package-controlled installation or runtime code executes with the privileges of the user running the installer. 6. The compromised package can affect the Skill whenever its Python scripts import or invoke that dependency. ## ...[truncated 482 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every direct and transitive dependency to an exact, reviewed version. 2. Generate a lock file containing cryptographic hashes, for example with `pip-compile --generate-hashes`. 3. Install with hash verification enabled: ```bash python3 -m pip install --require-hashes -r requirements.lock ``` 4. Create and use a dedicated virtual environment rather than modifying the active Python environment: ```bash python3 -m venv "$SCRIPT_DIR/.venv" "$SCRIPT_DIR/.venv/bin/python" -m pip install --require-hashes -r "$SCRIPT_DIR/requirements.lock" ``` 5. Review dependency updates before regenerating the lock file and use automated vulnerability and provenance scanning. 6. Avoid running the installer with administrative privileges. ]]>
