T08 · Insecure Dependencies
Warning
- Location
- scripts/install_deps.sh:9
- Finding
- Unpinned Dependency Installation with Unconditional Global Upgrades## Vulnerability Details **File Location**: `scripts/install_deps.sh`, line 9 **Vulnerability Type**: Unpinned third-party dependencies and unsafe environment-wide upgrades **Risk Level**: Medium ### Vulnerable Code ```bash echo "Installing MLX + inference deps (requires Apple Silicon macOS)..." pip install --upgrade mlx mlx-lm transformers ``` The related documentation also recommends unpinned installation of optional server dependencies at `SKILL.md`, line 87: ```bash pip install fastapi uvicorn[standard] ``` ### Technical Analysis The installation script retrieves mutable package versions and their transitive dependencies from the active Python package index. It neither pins exact versions nor verifies package hashes. The `--upgrade` option may also replace packages in the user's current Python environment, rather than limiting changes to an isolated environment. Python package installation can execute package build and installation logic. Consequently, a compromised upstream release, malicious package-index configuration, dependency-confusion condition, or compromised transitive dependency could execute code under the invoking user's account. Even without a malicious package, an incompatible future release could alter audited behavior or break other software in the same environment. This finding concerns the installation process. No evidence was found that the currently named packages are malicious. ### Attack Path 1. An attacker compromises a named or transitive package release, or influences the package index used by `pip`. 2. A user follows the documented Quick Start and runs `bash scripts/install_deps.sh`. 3. Line 9 invokes `pip install --upgrade` without version or hash constraints. 4. `pip` downloads the attacker-controlled or otherwise unaudited package version and executes its installation logic. 5. The payload runs with the permissions of the user who launched the installer and may modify that us ...[truncated 630 chars]
- Remediation
- ## Remediation Suggestions 1. Pin all direct and transitive dependencies to reviewed versions in a lock file. 2. Generate and verify cryptographic hashes, and install with `pip install --require-hashes`. 3. Create and use a dedicated virtual environment instead of modifying the active environment. 4. Remove the unconditional `--upgrade` behavior. 5. Configure and document a trusted package index. 6. Apply equivalent version and hash controls to the optional FastAPI and Uvicorn dependencies. 7. Periodically review and intentionally update the lock file after security and compatibility testing.
