T08 · Insecure Dependencies
Warning
- Location
- scripts/search_views.py:25
- Finding
- Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `scripts/search_views.py:25-30` **Vulnerability Type**: Unpinned and unverified third-party package installation **Risk Level**: Medium ### Vulnerable Code ```python try: from tavily import TavilyClient except ImportError: print("错误: 请先安装 tavily-python\n pip install tavily-python", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis When the Tavily client is unavailable, the script recommends installing `tavily-python` without specifying an audited version, package hash, lockfile, or trusted package index. The package and its transitive dependencies can therefore change independently of the reviewed Skill. Python packages may execute code during installation or when imported. If the referenced package, one of its dependencies, or the configured package index is compromised, following this installation instruction could execute attacker-controlled code. The repository does not contain evidence that the current Tavily package is malicious; the vulnerability is the absence of reproducible dependency and integrity controls. ### Attack Path 1. A user invokes the Skill's optional search functionality. 2. The environment does not contain the `tavily` module. 3. The script displays the unpinned `pip install tavily-python` instruction. 4. The user or Agent installs the package from the configured package index. 5. A compromised or unexpectedly changed package or transitive dependency is resolved. 6. Malicious package code executes during installation or subsequent import with the installing process's privileges. ### Impact Assessment Successful supply-chain exploitation could run arbitrary code with the privileges of the user or Agent process performing the installation. This could expose files, environment variables such as API credentials, and network resources accessible to that account. The issue does not itself provide privilege escalation beyond the i ...[truncated 95 chars]
- Remediation
- ## Remediation Suggestions 1. Declare an audited, exact `tavily-python` version in a dependency manifest or lockfile. 2. Pin all transitive dependencies and record cryptographic hashes. 3. Install dependencies with hash verification, such as `pip install --require-hashes -r requirements.txt`. 4. Use an isolated virtual environment rather than modifying the Agent's global Python environment. 5. Configure an explicitly trusted package index and disable unintended fallback indexes. 6. Add automated dependency vulnerability and integrity scanning. 7. Replace the free-form installation recommendation with documented, reproducible setup instructions.
