T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Dependency Is Not Exactly Version-Pinned or Hash-Verified
- Content
View full analysis
=1.28,<2 ``` `SKILL.md:19-24`: ```markdown The skill uses public, keyless endpoints and never connects to an exchange account. Before installing the Python dependency, explain the command and ask for confirmation: ```bash python3 -m pip install -r /requirements.txt ``` ``` ### Technical Analysis The `mcp` dependency is constrained only to a broad version range. Consequently, separate installations can resolve to different package releases, including future releases that were not present during this audit. No cryptographic hashes are supplied to verify the integrity of the resolved package or its transitive dependencies. The documentation appropriately requires user confirmation before installation, and no evidence indicates that the named package is currently malicious. However, confirmation alone does not ensure artifact integrity. If a permitted future release, transitive dependency, configured package index, or downloaded artifact is compromised, pip may install and subsequently import attacker-controlled Python code. ### Attack Path 1. An attacker compromises a permitted `mcp` release, one of its transitive dependencies, or a package index trusted by the user's pip configuration. 2. The user approves the documented installation command. 3. Pip resolves a compromised package version satisfying `>=1.28,<2`. 4. Because no expected hashes are specified, pip accepts the compromised artifact. 5. Malicious code executes during package installation or when `mcp` is imported by `scripts/mcp_server.py`. 6. The code operates with the permissions of the user running pip or the Skill. ### Impact Assessment Successful exploitation could execute arbitrary P ...[truncated 962 chars]- Remediation
View remediation
``` 2. Generate a fully resolved lock file containing hashes for the direct dependency and every transitive dependency. 3. Require hash verification during installation: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Install into a dedicated virtual environment or similarly isolated runtime rather than the user's global Python environment. 5. Explicitly configure a trusted package index and prevent unintended fallback to untrusted indexes. 6. Review dependency updates before changing the pinned version, including package provenance, release changes, and vulnerability advisories. 7. Preserve the existing requirement to explain the installation command and obtain user confirmation. ]]>
