T08 · Insecure Dependencies
- Location
graphify_wrapper.py:13- Finding
Unpinned Automatic Installation and Execution of a Third-Party Package
- Content
View full analysis
Vulnerability Details
File Location:
graphify_wrapper.py, lines 13 and 18–39
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: MediumVulnerable Code
python GRAPHIFY_PKG = "graphifyy" def _run(cmd, **kwargs): """Run a command, return CompletedProcess.""" return subprocess.run(cmd, capture_output=True, text=True, timeout=kwargs.pop("timeout", 120), **kwargs) def ensure_installed(): """Ensure graphify is installed, install if missing. Returns python path.""" # Try importing graphify r = _run([sys.executable, "-c", "import graphify"]) if r.returncode == 0: return sys.executable # Install print(f"Installing {GRAPHIFY_PKG}...") r = _run([sys.executable, "-m", "pip", "install", "-q", GRAPHIFY_PKG], timeout=120) if r.returncode != 0: print(f"Install failed: {r.stderr}") sys.exit(1) # Verify r = _run([sys.executable, "-c", "import graphify"]) if r.returncode != 0: print("Install succeeded but import failed") sys.exit(1) return sys.executableThe automatic installation is also presented as expected usage in
SKILL.md, lines 20–24 and 96–98:markdown ### Step 1 — Ensure graphify is installed ```bash python graphify_wrapper.py ensure-installedDependencies
- Python 3.10+
graphifyy(pip) — automatically installed by wrapper
text ### Technical Analysis The wrapper installs `graphifyy` from the process's active pip index without an exact version constraint, cryptographic hash verification, or a dependency lock file. Consequently, the effective dependency code can change after the Skill itself has been audited. The risk also depends on the environment's pip configuration. A compromised package release, compromised package index, or attacker-controlled alternate index could cause pip to retrieve and install unauthorized code. After installation, the wrapper imports and executes the dependency throu ...[truncated 1707 chars]- Remediation
View remediation
Remediation Suggestions
-
Pin
graphifyyto a specifically reviewed version rather than installing an unconstrained latest release:python GRAPHIFY_PKG = "graphifyy==<reviewed-version>" -
Maintain a locked requirements file containing hashes and install it with hash enforcement:
bash python -m pip install --require-hashes -r requirements.lock -
Pin and hash all transitive dependencies, not only the direct package.
-
Explicitly use a trusted package index and prevent unintended fallback to additional indexes. Review environment-level pip configuration before installation.
-
Avoid automatic dependency installation during normal Skill execution. Instead, fail safely with clear, separately documented installation instructions that require explicit user approval.
-
Install the dependency in a dedicated virtual environment or other sandbox rather than modifying the Agent's active Python environment.
-
Execute graph processing with least privilege and restrict its filesystem, credential, and network access where the runtime supports sandboxing.
-
Verify the pinned release's provenance and integrity before updating the lock file. Re-audit package updates before deployment.
-
