T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned and Cross-Ecosystem Dependencies Create Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Locations**: - `requirements.txt:1-3` - `setup.py:10-14` - `package.json:19-23` **Vulnerability Type**: Unpinned dependencies and incorrect cross-ecosystem dependency declarations **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1-3`: ```text pandas requests beautifulsoup4 ``` `setup.py:10-14`: ```python install_requires=[ "pandas", "requests", "beautifulsoup4" ] ``` `package.json:19-23`: ```json "dependencies": { "pandas": "^2.0.0", "requests": "^2.31.0", "beautifulsoup4": "^4.12.0" } ``` ### Technical Analysis The Python dependency manifests do not pin exact versions or provide integrity hashes. Consequently, each installation may resolve different package versions from the configured package index. This prevents reproducible dependency verification and increases exposure to compromised releases, malicious package indexes, or unexpected compatibility changes. The npm manifest also declares `pandas`, `requests`, and `beautifulsoup4` as npm dependencies even though the implementation uses the corresponding Python libraries. npm packages and Python packages with similar names are independent artifacts. Tooling that automatically processes `package.json` could therefore install unnecessary or unintended npm packages that are not required by the Skill. No lockfile or integrity-controlled dependency manifest is included for either ecosystem. The audit did not establish that any currently resolved dependency is malicious; the vulnerability is the unsafe and ambiguous dependency-resolution configuration. ### Attack Path 1. A user or automated Agent installs the project using `pip install -e .`, `pip install -r requirements.txt`, or npm-based project tooling. 2. The package manager resolves mutable dependency versions from its configured registry. 3. An attacker compromises a permitted dependency release or registry, or causes an unintended similarly named npm artifact to be selected. ...[truncated 1137 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every Python dependency to an exact, tested version rather than using unrestricted package names. 2. Generate a lockfile containing hashes, such as a hash-checked requirements file produced with `pip-tools`. 3. Install dependencies with integrity enforcement, for example: ```bash pip install --require-hashes -r requirements.lock ``` 4. Configure installation to use an explicitly trusted Python package index and prevent unintended fallback to untrusted indexes. 5. Remove the npm `dependencies` section—and preferably `package.json` entirely—if Node.js is not part of the Skill's runtime. 6. If npm metadata is genuinely required, do not list Python libraries as npm dependencies. Declare only verified Node.js packages that serve a documented purpose and commit the generated lockfile. 7. Use isolated, least-privileged build environments without unnecessary credentials or host filesystem access. 8. Add automated dependency vulnerability and provenance scanning to the release process. ]]>
