T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unbounded Third-Party Dependencies Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-2`; also declared in `package.json:17-22` **Vulnerability Type**: Supply-chain risk from unbounded dependency resolution **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1-2`: ```text arxiv>=2.0.0 pymongo>=4.0.0 ``` `package.json:17-22`: ```json "dependencies": { "python": ">=3.8", "arxiv": ">=2.0.0" }, "optional_dependencies": { "pymongo": ">=4.0.0" } ``` ### Technical Analysis The project specifies minimum dependency versions with no upper bounds, exact pins, lockfile, or package integrity hashes. A fresh installation can consequently resolve to any future version of `arxiv` or `pymongo`, including a compromised or malicious release that was never reviewed with this Skill. Python packages can execute code during installation and whenever imported. Both dependencies are imported by `arxiv_tool.py`, with `pymongo` imported automatically whenever it is installed. Therefore, compromise of an allowed dependency version could result in attacker-controlled code running in the Skill's process. Although MongoDB support is documented as optional, `requirements.txt` installs `pymongo` unconditionally. This unnecessarily expands the core installation's dependency and attack surface beyond what is required for searching, retrieving, and downloading arXiv papers. This finding does not establish that the current upstream packages are malicious. The vulnerability is the project's failure to constrain and verify the dependency versions installed in the future. ### Attack Path 1. An attacker compromises an upstream dependency maintainer account, distribution infrastructure, or another authorized release channel for `arxiv` or `pymongo`. 2. The attacker publishes a malicious release whose version satisfies the project's open-ended `>=` constraint. 3. A user installs or updates the Skill's dependencies without a previously locked environment. 4. The package resolver selects t ...[truncated 870 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace open-ended dependency ranges with exact, reviewed versions, for example: ```text arxiv==<reviewed-version> pymongo==<reviewed-version> ``` 2. Generate and commit a lockfile containing the complete transitive dependency graph. 3. Require cryptographic hashes during installation, such as a hash-locked requirements file used with: ```bash pip install --require-hashes -r requirements.txt ``` 4. Move `pymongo` out of the default requirements file and into an optional dependency group so users who only need arXiv functionality do not install it. 5. Use automated dependency scanning and controlled update reviews before accepting new package versions. 6. Install dependencies in an isolated virtual environment or least-privileged container, and avoid running installation or the Skill as an administrator. 7. Keep the dependency declarations in `requirements.txt` and `package.json` synchronized to prevent installation behavior from differing across tooling. ]]>
