T08 · Insecure Dependencies
Warning
- Location
- README.md:17
- Finding
- Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `README.md:17` **Vulnerability Type**: Unpinned dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash pip install requests ``` ### Technical Analysis The installation command does not specify a reviewed version, lockfile, package hash, or trusted package index. Consequently, installation results may change over time and are determined by the active Python package index and resolver configuration. If the configured package index is compromised, replaced by an untrusted mirror, or serves a malicious future release, following this instruction could install attacker-controlled code. Python packages may execute code during installation, while imported package code executes with the privileges of the application process. The dependency name itself is legitimate and there is no evidence that the project intentionally references a malicious package. Exploitation therefore requires an external supply-chain compromise or an attacker-controlled package source. ### Attack Path 1. An attacker compromises the configured package index, dependency distribution channel, or network/package-manager configuration. 2. The attacker makes a malicious version of `requests` available as the version selected by pip. 3. A user follows the documented `pip install requests` instruction. 4. Pip downloads and installs the malicious release because no version or integrity hash is enforced. 5. Malicious code executes during package installation or when `ima_board.py` imports `requests`. ### Impact Assessment Malicious dependency code would execute with the privileges of the user or service installing or running this skill. Depending on those privileges, it could access local files, environment variables, and the IMA credentials stored in `IMA_OPENAPI_CLIENTID` and `IMA_OPENAPI_APIKEY`; make network requests; alter application behavior; or compromise other data available to the proces ...[truncated 126 chars]
- Remediation
- ## Remediation Suggestions - Pin `requests` to a specifically reviewed version rather than allowing unrestricted resolution. - Maintain dependencies in a requirements or lock file. - Record and enforce cryptographic hashes, such as with pip's `--require-hashes` option. - Install packages only from an explicitly configured, trusted package index. - Integrate dependency vulnerability and provenance scanning into release workflows. - Periodically review and deliberately update the pinned version after security testing. Example hardened workflow: ```text requests==<reviewed-version> --hash=sha256:<verified-package-hash> ``` ```bash python -m pip install --require-hashes -r requirements.txt ```
