T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Allow Unreviewed Package Versions
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-2andSKILL.md:61-65
Vulnerability Type: Unpinned and unhashed third-party dependencies
Risk Level: MediumVulnerable Code
requirements.txt:1-2:text pypdf>=3.0.0 Pillow>=10.0.0SKILL.md:61-65:markdown ## Installation ```bash pip install pypdf pillowtext ### Technical Analysis The dependency declarations specify only minimum versions, while the documented installation command does not specify versions at all. Consequently, installation resolves whichever compatible package releases are available from the configured package index at that time. The project also provides no lockfile or cryptographic hashes with which to verify downloaded artifacts. This makes builds non-reproducible and allows future, unreviewed versions of `pypdf` or `Pillow` to enter the execution environment automatically. If an upstream release, package-index account, configured mirror, or dependency artifact were compromised, installation could introduce attacker-controlled code without any change to this repository. Python packages may execute code during build or installation, and malicious code could also run when the installed modules are imported by the scripts. No evidence was found that the currently named packages are typosquatted or malicious. The risk arises from unconstrained future resolution and missing artifact verification. ### Attack Path 1. An attacker compromises an upstream dependency release process, package-index account, distribution artifact, or package mirror used by the operator. 2. The attacker publishes a malicious release that satisfies `pypdf>=3.0.0` or `Pillow>=10.0.0`. 3. A user follows the installation instructions or installs `requirements.txt`. 4. `pip` resolves and downloads the malicious, unreviewed release because no exact version or artifact hash is enforced. 5. Attacker-controlled cod ...[truncated 726 chars]- Remediation
View remediation
Remediation Suggestions
- Pin every direct dependency to an exact, reviewed version, for example:
text pypdf==<reviewed-version> Pillow==<reviewed-version> - Generate and commit a lockfile that also fixes transitive dependency versions.
- Record approved artifact hashes and install with
pip --require-hashesso substituted distributions are rejected. - Update
SKILL.mdto instruct users to install from the reviewed requirements or lockfile rather than running unconstrainedpip install pypdf pillow. - Perform dependency updates through a controlled review process that includes vulnerability scanning, release-note review, automated tests, and deliberate lockfile regeneration.
- Use a trusted package index, restrict unapproved mirrors, and install into an isolated virtual environment under a non-privileged account.
- Pin every direct dependency to an exact, reviewed version, for example:
