T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Create a Mutable Supply-Chain Boundary
- Content
View full analysis
=2.28.0 beautifulsoup4>=4.11.0 lxml>=4.9.0 python-docx>=0.8.11 ``` The installation metadata in `SKILL.md:19-23` also directs users to install the latest available packages without version or integrity constraints: ```yaml install: - id: python-deps kind: exec command: "pip3 install requests beautifulsoup4 lxml python-docx" label: "安装Python依赖" ``` ### Technical Analysis The requirements use lower-bound constraints rather than exact, reviewed versions. The installation command is even less restrictive and contains no version constraints. Neither mechanism verifies package hashes. Consequently, the effective code installed with the Skill can change after the Skill package has been audited. Future package releases, transitive dependency changes, source distributions, or a compromised package index could introduce incompatible or malicious installation behavior. Python packages and their build backends may execute code during installation. Although the listed package names are established projects and no malicious dependency was identified in the repository, the current configuration does not provide reproducible or integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises a permitted future version of a listed dependency, one of its transitive dependencies, or the configured package index. 2. A user follows the installation instruction or installs from `requirements.txt`. 3. Pip resolves the compromised version because the project permits any version at or above the stated minimum. 4. Malicious build or package code executes under the account performing the installation. 5. The malicious dependency can subsequently execute whenever the Skill imports or uses the affected package. ### Impact Assessment T ...[truncated 612 chars]- Remediation
View remediation
beautifulsoup4== lxml== python-docx== ``` 2. Generate a lock file that includes all transitive dependencies. 3. Require package hashes by using a hash-locked requirements file and `pip install --require-hashes`. 4. Make the installation metadata invoke the same locked dependency file instead of installing unconstrained package names. 5. Use `python3 -m pip` to ensure dependencies are installed into the intended interpreter. 6. Install inside a dedicated virtual environment or container and never run pip with administrative privileges. 7. Configure an approved package index and disable unexpected fallback indexes. 8. Regularly scan locked dependencies for known vulnerabilities and review updates before changing pins. ]]>
