T08 · Insecure Dependencies
Warning
- Location
- scripts/install_local_whisper.sh:10
- Finding
- Unpinned Executable Dependencies and Unverified Mutable Bootstrap Script<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install_local_whisper.sh`, lines 10–29 **Vulnerability Type**: Supply-chain exposure through unpinned dependencies and unverified remote code execution **Risk Level**: Medium ### Vulnerable Code ```bash curl -fsSL https://bootstrap.pypa.io/get-pip.py -o "$TMPDIR_RUN/get-pip.py" "$PYTHON_BIN" "$TMPDIR_RUN/get-pip.py" --user --break-system-packages fi "$PYTHON_BIN" -m pip install --user --break-system-packages \ imageio-ffmpeg \ more-itertools \ numba \ numpy \ tiktoken \ tqdm \ triton \ regex \ filelock \ sympy \ networkx \ fsspec "$PYTHON_BIN" -m pip install --user --break-system-packages \ --index-url https://download.pytorch.org/whl/cpu \ torch "$PYTHON_BIN" -m pip install --user --break-system-packages --no-deps openai-whisper ``` ### Technical Analysis The installer downloads `get-pip.py` from a mutable external URL and immediately executes it without checking a cryptographic digest or signature. Although HTTPS protects the connection in transit under normal conditions, it does not ensure that the downloaded content is the exact version previously reviewed by the project. The subsequent package installations do not pin package versions or verify distribution hashes. Package installation may execute package-controlled build or installation logic with the permissions of the user running the script. The effective code installed by this script can therefore change over time without any corresponding change to the audited repository. The package indexes and bootstrap domain shown in the script are legitimate sources, and the audited code contains no evidence that a malicious package was intentionally selected. This is therefore a supply-chain hardening defect rather than evidence of embedded malware. ### Attack Path 1. An attacker compromises an upstream package release, package-maintainer account, package index, bootstrap resource, or another relevant distr ...[truncated 1291 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to a reviewed, exact version in a lock or requirements file. 2. Generate and record cryptographic hashes for every permitted distribution artifact, then install with `pip --require-hashes`. 3. Avoid downloading and executing `get-pip.py` dynamically. Prefer a trusted operating-system package, a pre-provisioned Python environment, or a vendored and reviewed bootstrap artifact. 4. If bootstrap downloading is unavoidable, pin a specific reviewed artifact and verify its SHA-256 digest or trusted signature before execution. 5. Install the toolchain inside a dedicated virtual environment rather than combining `--user` with `--break-system-packages`. 6. Pin the PyTorch CPU package and `openai-whisper` to reviewed versions, including hashes from their intended indexes. 7. Configure package-index allowlisting and ensure that each package is resolved only from its expected source. 8. Add automated dependency vulnerability scanning and a controlled process for reviewing and updating locked versions. ]]>
