T08 · Insecure Dependencies
Warning
- Location
- references/troubleshooting.md:181
- Finding
- Unpinned Third-Party Package Installation Instructions<![CDATA[ ## Vulnerability Details **File Location**: `references/troubleshooting.md`, lines 181, 194, 205, 215, 229, and 280 **Vulnerability Type**: Uncontrolled third-party dependency resolution **Risk Level**: Medium ### Vulnerable Code ```bash pip install black pip install pylint pip install flake8 pip install mypy pip install codeclimate pip install pytest-cov ``` ### Technical Analysis The troubleshooting documentation instructs users or agents to install third-party packages from the currently configured Python package index without pinning reviewed versions, verifying package hashes, specifying a trusted index, or requiring an isolated environment. An unpinned installation resolves whichever package version and transitive dependencies are available at execution time. Consequently, the effective code installed can change after this Skill has been reviewed. Python package installation may execute package build logic, and installed packages execute code when subsequently invoked or imported. There is no evidence that the named packages are currently malicious. The vulnerability is the mutable and unverified dependency-resolution process, which exposes users to compromised releases, compromised transitive dependencies, or an attacker-controlled package index. ### Attack Path 1. A user or agent follows the troubleshooting instructions. 2. The installation runs against the environment's configured package index. 3. An attacker has compromised a named package, one of its dependencies, or the configured index. 4. Because versions and hashes are not constrained, pip resolves the attacker-controlled artifact. 5. Malicious build-time code may execute during installation, or malicious runtime code may execute when the tool is used. 6. The payload runs with the permissions of the user performing the installation. ### Impact Assessment Successful exploitation can execute arbitrary code with the invoking user's privileges. Depending on those privileges and th ...[truncated 620 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace ad hoc installation commands with a reviewed, version-locked dependency file. 2. Pin exact package and transitive dependency versions. 3. Generate and verify cryptographic hashes, for example with a hash-locked requirements file and `pip install --require-hashes`. 4. Use an explicitly trusted package index rather than silently inheriting arbitrary index configuration. 5. Install tools inside a dedicated virtual environment or disposable container. 6. Separate optional development tools from runtime dependencies. 7. Scan locked dependencies for known vulnerabilities and periodically review updates before changing pins. 8. Require explicit user approval before an agent installs external packages. Example hardened workflow: ```bash python -m venv .venv . .venv/bin/activate python -m pip install \ --require-hashes \ --index-url https://pypi.org/simple \ -r requirements-tools.txt ``` The referenced requirements file should contain reviewed exact versions and hashes for every direct and transitive dependency. ]]>
