T08 · Insecure Dependencies
- Location
scripts/install_deps.py:18- Finding
Automatic Installation of an Unpinned Third-Party Dependency
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install_deps.py:18-31
Vulnerability Type: Unpinned dependency installation from a mutable package index
Risk Level: MediumComplete Code Snippet
python # Try installation methods in order of preference install_methods = [ [sys.executable, "-m", "pip", "install", "--user", "Pillow"], [sys.executable, "-m", "pip", "install", "Pillow"], [sys.executable, "-m", "pip3", "install", "Pillow"], ] for i, cmd in enumerate(install_methods): try: print(f" Attempt {i+1}/{len(install_methods)}: {' '.join(cmd)}") result = subprocess.run( cmd, capture_output=True, text=True, timeout=120, )The installer is invoked as a mandatory prerequisite by
SKILL.md:67-70:bash python3 SKILL_DIR/scripts/install_deps.pyTechnical Analysis
The dependency installer passes the package name
Pillowtopipwithout a fixed version, cryptographic hash, lock file, or explicitly trusted package index. Consequently, the exact artifact installed depends on mutable package-index state at execution time rather than on an artifact reviewed with this skill.Although
subprocess.runuses an argument list and does not enable a shell, which prevents shell-command injection through this static command, it does not mitigate software supply-chain risk. A compromised upstream release, package-index account, index mirror, or package-resolution configuration could cause unreviewed code to be downloaded and installed.The first attempt uses
--user, modifying the invoking user's Python environment. The fallback attempts target the active interpreter environment. Installation is not isolated in a dedicated virtual environment.Attack Path
- An attacker compromises an upstream dependency release, its publishing account, the configured package index or mirror, or the local pip index configuration.
- A user or agent activates ...[truncated 1052 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin Pillow to a specifically reviewed version rather than resolving the latest available release.
- Store the dependency in a locked requirements file with cryptographic hashes, for example:
text Pillow==REVIEWED_VERSION \ --hash=sha256:REVIEWED_DISTRIBUTION_HASH - Install with hash enforcement:
bash python3 -m pip install --require-hashes -r requirements.txt - Use a dedicated virtual environment instead of modifying the user's or active interpreter's package environment.
- Specify an approved HTTPS package index and prevent untrusted extra indexes or mirrors from influencing resolution.
- Review dependency updates before changing the pinned version or hashes.
- Ask for explicit user approval before downloading or installing packages, and clearly disclose the target environment.
- Where practical, distribute a verified wheel or use an organization-controlled artifact repository.
