T08 · Insecure Dependencies
- Location
agent.py:9- Finding
Unpinned Third-Party Dependency Installation Guidance
- Content
View full analysis
Vulnerability Details
File Location:
agent.py, lines 9–13
Vulnerability Type: Unpinned and unverified third-party dependency
Risk Level: Mediumpython try: import qrcode except ImportError: print("Error: qrcode library not installed", file=sys.stderr) print("Install with: pip install qrcode[pil]", file=sys.stderr) sys.exit(1)Technical Analysis
When the
qrcodemodule is unavailable, the script instructs the user to installqrcode[pil]without specifying a reviewed version, cryptographic hashes, or a trusted package index. Package resolution therefore depends on mutable metadata and artifacts supplied by the active pip index and the user's local pip configuration.This guidance also conflicts with
SKILL.mdline 29, which explicitly instructs users not to install libraries themselves. Although the script does not automatically execute pip, its prescribed recovery action exposes users who follow it to supply-chain risk. A compromised package release, package index, dependency, or configured mirror could introduce arbitrary code during installation or subsequent import.Attack Path
- The user invokes the skill in an environment where
qrcodeis not installed. - The import fails, and the script displays
pip install qrcode[pil]. - The user follows the displayed instruction.
- pip resolves an unpinned version and its transitive dependencies from the configured package index or mirror.
- If that source or a resolved artifact has been compromised or substituted, attacker-controlled code executes during installation or when
qrcodeis later imported. - The malicious code runs with the privileges of the user or environment performing the installation or invocation.
Impact Assessment
Successful exploitation could permit arbitrary code execution with the installing user's privileges. The resulting scope may include access to that user's files, environment ...[truncated 374 chars]
- The user invokes the skill in an environment where
- Remediation
View remediation
Remediation Suggestions
- Remove the ad hoc
pip install qrcode[pil]instruction from runtime error output. - Declare
qrcode[pil]in a reviewed dependency manifest or lockfile using an exact approved version. - Require cryptographic hashes for all direct and transitive packages, such as through a hash-locked requirements file and
pip install --require-hashes. - Install packages only from an approved, authenticated package repository or controlled internal mirror.
- Integrate dependency vulnerability and integrity scanning into the release process.
- Document a controlled installation workflow consistent with the prohibition in
SKILL.mdagainst users installing dependencies themselves. - Run the skill in an isolated, least-privileged environment so a compromised dependency cannot access unrelated user or system resources.
- Remove the ad hoc
