T08 · Insecure Dependencies
- Location
scripts/extract_exif.py:26- Finding
Runtime Installation of an Unpinned Third-Party Dependency
- Content
View full analysis
Vulnerability Details
File Location:
scripts/extract_exif.py:26-28
Vulnerability Type: Runtime supply-chain exposure through an unpinned dependency
Risk Level: MediumVulnerable Code:
python subprocess.check_call( [sys.executable, "-m", "pip", "install", "--quiet", "pillow>=10.0.0"] )The same lower-bound-only dependency constraint appears in
requirements.txt:1:text pillow>=10.0.0Technical Analysis
When Pillow is unavailable and the optional auto-install mode is enabled, the script invokes pip at runtime. The constraint specifies only a minimum version, so pip may resolve and install any future version available from the configured package index. This makes dependency resolution non-reproducible and creates a supply-chain execution boundary during normal Skill use.
The dependency is functionally legitimate: Pillow is used to parse image metadata, its package name is correct, and no suspicious package source is explicitly configured. However, installing it dynamically is not required for the Skill's core writing functionality because the documented fallback can ask the user for the photo's time and location. Runtime installation therefore exceeds the minimum behavior necessary to provide the declared functionality.
Attack Path
- The environment does not already contain Pillow.
- A user provides one or more images for EXIF processing.
- The Agent or user invokes
scripts/extract_exif.pywith--auto-install, or setsMY_PROSE_POEM_AUTO_INSTALL=1. - The script executes pip using the current Python interpreter.
- Pip resolves the latest package satisfying
pillow>=10.0.0from the environment's configured index. - If the selected distribution or package index is compromised, attacker-controlled installation or package code may execute with the privileges of the Agent process.
- The compromised dependency may then access files, network resour ...[truncated 800 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove automatic dependency installation from the runtime script.
- If Pillow is missing, return the existing error and use the documented fallback of asking the user for capture time and location.
- Require dependency installation as an explicit setup action rather than performing it while processing user content.
- Pin Pillow to a reviewed exact version instead of using a lower-bound-only constraint.
- Generate and verify cryptographic hashes for approved distributions, for example through a hash-locked requirements file.
- Install dependencies inside an isolated virtual environment with minimal filesystem and network permissions.
- Configure pip to use an explicitly trusted package index and disable unexpected supplemental indexes.
- Establish a controlled dependency-update process that includes vulnerability review and regression testing before changing the pinned version.
