T08 · Insecure Dependencies
- Location
README.md:18- Finding
Unpinned Python Dependencies Allow Supply-Chain Compromise
- Content
View full analysis
Vulnerability Details
File Location:
README.md:18andSKILL.md:49
Vulnerability Type: Unpinned third-party Python dependencies
Risk Level: MediumVulnerable Code
README.md:18:bash pip install people-also-ask beautifulsoup4 requestsSKILL.md:49:bash pip install people-also-ask beautifulsoup4 requestsThe installed
people-also-askpackage is subsequently loaded bykeyword_miner.py:31:python import people_also_ask as paaTechnical Analysis
The documented installation command retrieves the current versions of three third-party packages without exact version constraints, cryptographic hashes, or a dependency lockfile. Consequently, the code installed by users can differ from the code reviewed during this audit.
Python packages may contain package-controlled build logic, transitive dependencies, and executable module initialization code. A compromised publisher account, malicious replacement release, or compromised transitive dependency could therefore introduce attacker-controlled code. The
people-also-askpackage is also imported during normal use, causing its module initialization code to run in the Python process.No evidence was found that the dependencies currently named by the project are malicious. The vulnerability is the mutable and unverifiable dependency resolution process.
Attack Path
- An attacker compromises a named dependency, one of its transitive dependencies, or the corresponding package publisher account.
- The attacker publishes a malicious release that remains compatible with the unrestricted package name.
- A user follows the documented
pip installcommand. - Pip resolves the compromised release because no reviewed version or hash is required.
- Malicious package code executes during a source build or when the installed module is imported.
- The payload operates with the permissions and environment access of ...[truncated 599 chars]
- Remediation
View remediation
Remediation Suggestions
- Create a dependency manifest containing exact, reviewed versions for all direct and transitive dependencies.
- Generate and verify cryptographic hashes, then install with a command such as:
bash python3 -m pip install --require-hashes -r requirements.txt - Replace both unrestricted installation examples with installation from the locked manifest.
- Review dependency release artifacts before updating versions and use automated vulnerability and provenance scanning.
- Prefer binary wheels from trusted publishers where appropriate, and prevent unexpected source builds in deployment environments.
- Install and run the project in an isolated virtual environment or restricted container without unnecessary credentials or filesystem access.
- Remove dependencies that are not actually required by the implementation to reduce the supply-chain attack surface.
