T08 · Insecure Dependencies
- Location
README.md:16- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
README.md:16-23
Vulnerability Type: Unpinned third-party dependency
Risk Level: MediumThe installation documentation instructs users to install Pillow without pinning a reviewed version or verifying package integrity:
markdown ### Dependencies - Python 3 - [Pillow](https://pillow.readthedocs.io/) (used for image annotation) ```bash pip3 install Pillowtext The dependency is imported and used by `scripts/annotate.py:21-25`: ```python try: from PIL import Image, ImageDraw, ImageFont except ImportError: print("ERROR: Pillow is required. Install with: pip3 install Pillow", file=sys.stderr) sys.exit(1)Technical Analysis
pip3 install Pillowresolves a mutable package version from the user's configured Python package index. The project provides no exact version constraint, lockfile, package hash, or trusted-index requirement. Consequently, two installations performed at different times may retrieve different artifacts that were not reviewed with this project.This creates supply-chain exposure if the upstream package, a release artifact, a package-index account, or the user's configured package mirror is compromised. It can also introduce unreviewed behavioral or compatibility changes. This finding does not establish that Pillow itself is malicious; the weakness is the absence of reproducible and integrity-verified dependency resolution.
Attack Path
- An attacker compromises an upstream release channel, package-index account, distribution artifact, or package mirror used by the victim.
- The attacker publishes or substitutes a malicious package version that satisfies the unconstrained
Pillowrequirement. - A user follows the documented
pip3 install Pillowcommand. pipresolves and installs the attacker-controlled release because no version or hash is enforced.- Malicious installation or runtime code e ...[truncated 879 chars]
- Remediation
View remediation
Remediation Suggestions
-
Add a dependency manifest that pins Pillow to a specifically reviewed version, for example:
text Pillow==<reviewed-version> -
Generate and enforce cryptographic hashes for approved distribution artifacts, such as with a hash-locked requirements file and:
bash python3 -m pip install --require-hashes -r requirements.txt -
Commit the dependency file to the project and update the README to use it instead of installing an unconstrained package directly.
-
Review dependency updates before changing the pinned version and use automated vulnerability and provenance checks in CI.
-
Recommend installation inside a dedicated virtual environment under a non-privileged user account.
-
Use an explicitly trusted package index or controlled internal mirror where appropriate, and avoid running
pipwith administrator or root privileges.
-
