T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Mutable and Unverified Third-Party Dependencies
- Content
View full analysis
=0.10.0 pandas>=1.5.0 ``` `SKILL.md:21` and `README.md:20`: ```bash pip install pywencai --upgrade ``` `demo_project/README.md:9`: ```bash pip install -r ../requirements.txt ``` ### Technical Analysis The project installs third-party packages using open-ended minimum-version constraints. It also explicitly recommends installing the newest available `pywencai` release with `--upgrade`. Consequently, installation results can change over time without any modification to this audited artifact. No lockfile, exact version pins, package hashes, or other integrity controls constrain the downloaded artifacts to reviewed versions. A future package release would therefore be trusted and executed automatically when users follow the documented installation process. This risk is particularly relevant for `pywencai` because the Skill supplies it with an authenticated iWenCai session cookie and states that the package executes JavaScript through Node.js. The actual `pywencai` implementation is not bundled in this project, so its runtime handling of credentials, network traffic, and JavaScript cannot be verified by this audit. There is no evidence that the dependency versions currently available are malicious. The vulnerability is the project's mutable and non-reproducible dependency trust model. ### Attack Path 1. An attacker compromises a future release, maintainer account, distribution infrastructure, or transitive dependency associated with `pywencai` or `pandas`. 2. The attacker publishes a release satisfying the unrestricted `>=` constraint, or the release becomes the version selected by `pip install pywencai --upgrade`. 3. A user follows the document ...[truncated 1161 chars]- Remediation
View remediation
pandas== ``` 2. Generate and commit a reproducible lockfile covering direct and transitive dependencies. 3. Require package hashes during installation, for example by generating a hash-locked requirements file and installing it with: ```bash pip install --require-hashes -r requirements.lock ``` 4. Remove unconditional `--upgrade` instructions. Dependency upgrades should occur only through a controlled review process that examines release changes and regenerates approved hashes. 5. Configure installation to use a trusted package index and disallow unexpected alternate or supplemental indexes. 6. Run dependency vulnerability and provenance checks in continuous integration before approving updates. 7. Execute the Skill in a least-privilege environment with restricted filesystem access and outbound network access limited to required destinations. 8. Keep the iWenCai cookie in a protected secret store or environment variable, avoid embedding it in source code, and use a dedicated session with the minimum available account privileges. ]]>
