T08 · Insecure Dependencies
- Location
scripts/install_deps.py:10- Finding
Unpinned Third-Party Dependency Installed at Runtime
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install_deps.py, lines 10–16
Vulnerability Type: Unpinned runtime dependency installation
Risk Level: MediumVulnerable Code
python REQUIRED = ["pymupdf"] def main(): print("[INFO] Installing dependency: pymupdf ...") result = subprocess.run( [sys.executable, "-m", "pip", "install", "--quiet", *REQUIRED], capture_output=True, text=True, )The installation is also explicitly included in the documented workflow in
SKILL.md, lines 25–31:bash <python> scripts/install_deps.pyTechnical Analysis
The installation script invokes
pipto resolve and installpymupdfwithout pinning an audited version or verifying package hashes. It also does not require a locked dependency file or explicitly constrain package retrieval to a controlled repository.Consequently, the code installed during each Skill initialization can change independently of the reviewed project. Python package installation may execute third-party build or installation logic, while later importing
fitzexecutes the installed package's runtime code. This creates a supply-chain trust boundary that is not controlled by the audited source tree.This finding does not establish that the current PyMuPDF package is malicious. The vulnerability is the uncontrolled and non-reproducible dependency resolution process.
Attack Path
- The Agent follows the dependency setup instructions in
SKILL.md. - It executes
scripts/install_deps.py. - The script runs
python -m pip install --quiet pymupdf. pipresolves a package version from its configured package index without a version or hash constraint.- If the selected release, distribution artifact, configured index, or dependency resolution path has been compromised, attacker-controlled package installation logic may execute.
- The Skill later imports
fitz, causing the installed package's runtime code to execute in the ...[truncated 866 chars]
- The Agent follows the dependency setup instructions in
- Remediation
View remediation
Remediation Suggestions
-
Pin PyMuPDF to a specifically reviewed version rather than resolving the latest release:
text pymupdf==X.Y.Z -
Store dependencies in a lock or requirements file with cryptographic hashes and install them using hash enforcement:
bash python -m pip install \ --require-hashes \ --only-binary=:all: \ -r requirements.txt -
Record hashes for every permitted distribution artifact and platform supported by the Skill.
-
Retrieve packages from an organization-controlled, authenticated repository or an approved package mirror rather than relying on an unconstrained index configuration.
-
Prefer provisioning dependencies outside Skill execution. Build an isolated virtual environment or container from a reviewed and immutable dependency manifest.
-
Run installation and PDF processing with least privilege, restricted network access, and filesystem access limited to required input and output locations.
-
Add automated dependency review, vulnerability scanning, and an explicit upgrade process so version changes are separately assessed before deployment.
-
