T08 · Insecure Dependencies
- Location
scripts/setup_env.py:22- Finding
Automatic Installation of Unpinned Third-Party Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup_env.py:22-27andscripts/setup_env.py:60-69; the installation workflow is invoked bySKILL.md:29-40
Vulnerability Type: Supply-chain risk caused by unpinned automatic dependency installation
Risk Level: MediumVulnerable Code
python REQUIRED_PACKAGES = { "cv2": "opencv-python", "numpy": "numpy", "av": "av", }python def install_packages(python_path, packages): """Install the specified packages in the virtual environment.""" if not packages: return True print(f"[..] Installing dependencies: {', '.join(packages)}") result = subprocess.run( [python_path, "-m", "pip", "install", "--quiet"] + packages, capture_output=True, text=True, ) if result.returncode != 0: print(f"[Error] Installation failed:\n{result.stderr}") return False print("[OK] Dependency installation completed") return TrueThe original source contains Chinese display strings, but the executable behavior represented above is unchanged: package names are passed directly to
pip installwithout version or integrity constraints.Technical Analysis
The documented workflow instructs the agent to run
setup_env.pywhen the required environment is unavailable. The script installsopencv-python,numpy, andavusing their bare package names. It does not specify exact versions, cryptographic hashes, an approved package index, or a reviewed lock file.As a result, the effective code installed and imported by the Skill can change after the Skill itself has been audited. Pip also uses the environment's configured indexes and mirrors, which may differ between systems. A compromised package release, transitive dependency, package index, or locally configured mirror could therefore introduce attacker-controlled code.
Installation and subsequent imports ex ...[truncated 1718 chars]
- Remediation
View remediation
Remediation Suggestions
-
Create a reviewed dependency manifest containing exact versions for every direct and transitive dependency.
-
Generate and verify cryptographic hashes for all approved distributions.
-
Install dependencies using a command such as:
bash python -m pip install --require-hashes -r requirements.txt -
Configure an explicit trusted package index or an internally controlled artifact repository rather than relying on ambient pip configuration.
-
Review and update pinned dependencies through a controlled process that includes vulnerability scanning and compatibility testing.
-
Prefer provisioning dependencies during an explicit installation phase rather than automatically downloading code during normal Skill execution.
-
If automatic installation must remain, fail closed when the lock file, hashes, approved index, or expected package versions cannot be verified.
-
Run dependency installation and media processing in a least-privileged, network-restricted environment with access limited to necessary input and output directories.
-
