T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned and Unnecessary Third-Party Dependencies Create Supply-Chain Exposure<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-3`; installation instruction at `SKILL.md:182-184` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1-3`: ```text dataclasses enum numpy ``` `SKILL.md:182-184`: ```bash # Python dependencies pip install -r requirements.txt ``` ### Technical Analysis All dependencies are specified without exact versions or integrity hashes. Consequently, installation resolves whichever compatible releases are available from the configured package index at installation time. This makes builds non-reproducible and prevents verification that the installed artifacts are the versions reviewed by the project author. The `enum` dependency is unnecessary on supported modern Python versions because `enum` is part of the Python standard library. Likewise, `dataclasses` is part of the standard library beginning with Python 3.7. Installing third-party packages corresponding to standard-library module names unnecessarily increases exposure to package substitution, dependency confusion, package-index compromise, and malicious release risks. The documentation states `numpy >= 1.21.0` at `SKILL.md:96`, but `requirements.txt` does not enforce even that lower bound. No upper bound, exact version, artifact hash, or trusted-index policy is provided. This finding does not establish that the currently published packages are malicious. The vulnerability is the installation process's inability to constrain and authenticate the code it installs. ### Attack Path 1. A user follows the documented prerequisite and runs `pip install -r requirements.txt`. 2. Pip queries the user's configured package index or mirror for `dataclasses`, `enum`, and `numpy`. 3. Because no exact versions or hashes are specified, pip accepts packages selected from the index at installation time. 4. An attacker compromises a relevant package release or package mirror, influences dependen ...[truncated 974 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `enum` because the implementation imports the standard-library `enum.Enum`. 2. Remove `dataclasses` when the project requires Python 3.7 or later. If legacy Python support is genuinely required, declare that support explicitly and conditionally install the reviewed backport using an environment marker. 3. Pin NumPy and every required transitive dependency to reviewed versions. 4. Generate and verify cryptographic hashes for all permitted artifacts. Install with hash enforcement, for example: ```bash python -m pip install --require-hashes -r requirements.txt ``` 5. Declare a supported Python version and keep documentation consistent with the dependency manifest. 6. Use a trusted package index, disallow unexpected extra indexes, and review lockfile changes before deployment. 7. Add automated dependency scanning and scheduled patch review rather than allowing unconstrained upgrades during installation. 8. Avoid installing dependencies with administrative or root privileges. ]]>
