T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:180
- Finding
- Unpinned Dependency Installation Creates Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:180`, `SKILL.md:243-244` **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```dockerfile RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt ``` ```text - `pip install fastapi[all]` - FastAPI with all optional dependencies - `pip install pytest anyio httpx` - async testing stack ``` ### Technical Analysis The Skill recommends installing Python packages without fixed versions or cryptographic hashes. Package resolution can therefore change between installations, making builds non-reproducible and allowing newly released or compromised direct and transitive dependencies to enter the environment without review. The `--upgrade` option further increases this exposure by directing `pip` to replace already installed packages with newer compatible versions. The Skill does not recommend a lock file, hash verification, dependency review, or a trusted package mirror. This is guidance rather than directly executed code, and there is no evidence that the currently named packages are malicious. The vulnerability arises when users copy these production patterns into build or deployment workflows. ### Attack Path 1. A developer follows the Skill and installs the dependencies without pinned versions or hashes. 2. The package resolver queries the configured Python package index during a later build. 3. A compromised, malicious, dependency-confused, or unexpectedly incompatible package version satisfies the mutable dependency constraints. 4. The package is downloaded and installed without integrity validation against a reviewed lock file. 5. Malicious installation hooks or imported package code execute with the privileges of the build process or application container. ### Impact Assessment Successful exploitation could execute arbitrary code within the dependency installation or application runtime context. The attainable privileg ...[truncated 459 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin all direct dependencies to reviewed versions. - Generate and commit a lock file that includes transitive dependencies. - Require cryptographic hashes during installation, such as with `pip install --require-hashes`. - Remove uncontrolled `--upgrade` behavior from production image builds. - Use an approved internal package mirror or explicitly trusted package index. - Scan dependencies and container images for known vulnerabilities. - Regularly update dependencies through a controlled review and testing process. - Replace the examples with hardened commands, such as installation from a hash-locked requirements file: ```dockerfile RUN pip install --no-cache-dir --require-hashes -r requirements.lock ``` ]]>
