T08 · Insecure Dependencies
Warning
- Location
- scripts/install.sh:5
- Finding
- Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install.sh:5` **Related Location**: `SKILL.md:25-26`, `SKILL.md:167-169` **Vulnerability Type**: Unpinned and unverified package installation **Risk Level**: Medium ### Vulnerable Code ```bash pip3 install requests ``` ### Technical Analysis The installation script asks pip to install the latest version of `requests` without a version constraint, lockfile, package hash, explicit trusted index, or isolated virtual environment. The package source can be influenced by pip configuration files and environment variables such as `PIP_INDEX_URL` and `PIP_EXTRA_INDEX_URL`. Consequently, executing the installer may retrieve a package artifact that was not reviewed with this Skill. Installation may also modify the invoking user's global or user-level Python environment. The package name itself is legitimate and no malicious dependency is embedded in the repository. Exploitation therefore depends on an attacker compromising or influencing the configured package source, package release, DNS/network trust chain, or local pip configuration. ### Attack Path 1. An attacker compromises a configured Python package index or modifies the victim's pip configuration or environment. 2. The user or Agent executes `bash scripts/install.sh`. 3. `pip3 install requests` resolves an artifact without enforcing a reviewed version or cryptographic hash. 4. Pip downloads and installs the attacker-influenced artifact. 5. Malicious package installation or runtime code executes with the privileges of the user who invoked the installer. ### Impact Assessment Successful exploitation can result in arbitrary code execution under the invoking user's account. This may permit access to files available to that user, including `~/.whoop/credentials.json`, `~/.whoop/token.json`, and other user-owned data. If the installer is run with elevated privileges, the impact could extend to system-wide Python packages and privileged filesyste ...[truncated 158 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `requests` and all transitive dependencies to reviewed versions. 2. Generate a dependency lockfile containing cryptographic hashes. 3. Install with hash enforcement, for example: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Use a dedicated virtual environment rather than modifying the global Python environment: ```bash python3 -m venv .venv .venv/bin/python -m pip install --require-hashes -r requirements.txt ``` 5. Document the expected package index and avoid automatically trusting indexes supplied through uncontrolled environment variables. 6. Periodically review and update pinned dependencies after security testing. ]]>
