T08 · Insecure Dependencies
- Location
evaluate.py:44- Finding
Automatic Installation and Execution of Inadequately Pinned Third-Party Dependencies
- Content
View full analysis
bool: """ Attempt to install sigui-sdk automatically if not found. Returns True if SDK is available after the attempt. """ try: from sigui import SiguiClient # noqa: F401 return True except ImportError: pass print("📦 sigui-sdk not found. Installing automatically...", file=sys.stderr) try: subprocess.check_call( [sys.executable, "-m", "pip", "install", "sigui-sdk>=0.3.1", "--quiet"], timeout=120, ) # Verify import works after install result = subprocess.run( [sys.executable, "-c", "from sigui import SiguiClient; print('ok')"], capture_output=True, text=True, timeout=10, ) if result.returncode == 0: print("✅ sigui-sdk installed successfully.", file=sys.stderr) return True else: print(f"❌ sigui-sdk installed but import failed: {result.stderr}", file=sys.stderr) return False except subprocess.TimeoutExpired: print("❌ Auto-install timed out. Run: pip install sigui-sdk>=0.3.1", file=sys.stderr) return False except Exception as e: print(f"❌ Auto-install failed: {e}", file=sys.stderr) print(" Run manually: pip install sigui-sdk>=0.3.1", file=sys.stderr) return False SIGUI_AVAILABLE = _auto_install_sdk() ``` `install.sh:91-106`: ```bash # ── Install sigui-sdk ───────────────────────────────────────────────────────── if $PYTHON -c "from sigui import SiguiClient" &>/dev/null 2>&1; then SDK_VER=$($PYTHON -c "import sigui; print(getattr(sigui, '__version__', 'unknown'))" 2>/dev/nu ...[truncated 3354 chars]- Remediation
View remediation
", "rich==", ] ``` Update versions through a controlled review and testing process. 3. **Use hash-verified dependency locking** - Generate a lock or requirements file containing hashes. - Install with hash enforcement, such as: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. **Restrict dependency sources** - Configure an explicitly trusted package index. - Avoid untrusted extra indexes and review organization-wide `pip` configuration that could enable dependency confusion. - For higher-assurance environments, mirror reviewed artifacts into an internally controlled repository. 5. **Install in an isolated, least-privileged environment** - Use a dedicated virtual environment or hardened container. - Never run dependency installation as root or with unnecessary host permissions. - Prevent the skill process from accessing unrelated credentials and sensitive files. 6. **Add continuous supply-chain checks** - Scan locked dependencies for known vulnerabilities. - Review dependency ownership and release provenance before upgrades. - Consider signed artifacts or provenance attestations when supported by the distribution channel. ]]>
