T08 · Insecure Dependencies
Error
- Location
- requirements.txt:1
- Finding
- Automatic Installation of Unpinned Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-2`, `install.sh:22-36`, `src/env_checker.py:35-43` **Vulnerability Type**: Supply-chain exposure through mutable dependency resolution **Risk Level**: High ### Vulnerable Code `requirements.txt:1-2`: ```text garth>=0.1.0 notebooklm-py>=0.3.0 ``` `install.sh:22-36`: ```bash pip install --upgrade pip if [ -f "requirements.txt" ]; then pip install -r requirements.txt else # 至少安装 garth pip install garth fi # 3. 检查并安装 notebooklm-py 及其依赖 echo "📦 安装 notebooklm-py 及浏览器驱动..." pip install "notebooklm-py[browser]" # 4. 自动下载 Playwright 所需的 Chromium 浏览器 echo "🌐 正在下载 Chromium 浏览器内核 (用于 AI 登录)..." python3 -m playwright install chromium ``` `src/env_checker.py:35-43`: ```python @staticmethod def run_install(): """执行安装脚本并返回结果""" try: # 使用 sys.executable 确保在同一个 python 环境下安装 print("Installing dependencies...") subprocess.check_call([sys.executable, "-m", "pip", "install", "notebooklm-py[browser]"]) print("Downloading browser core...") subprocess.check_call([sys.executable, "-m", "playwright", "install", "chromium"]) ``` ### Technical Analysis The application installs packages using lower-bound version constraints rather than exact, verified versions. It also downloads the current Playwright Chromium build without an application-controlled checksum or artifact lock. Python package installation can execute package build and installation logic. Consequently, the effective code installed by this Skill may differ from the code reviewed during the audit. The runtime setup flow makes this especially significant because a user can trigger package installation by replying affirmatively to the interactive setup prompt. This finding does not establish that the named packages are malicious. The vulnerability is that the Skill has no reproducible dependency lock, hash verification, or upper version boundary to protect it from a compromise ...[truncated 1207 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace lower-bound constraints with exact, reviewed versions for direct and transitive dependencies. 2. Generate a lockfile containing hashes, such as a `pip-tools` requirements file with `--generate-hashes`. 3. Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Pin the Playwright package and corresponding browser revision, and verify downloaded artifacts through a trusted integrity mechanism. 5. Avoid installing packages from a chat-triggered runtime path. Perform dependency installation during a separate, explicit administrative deployment stage. 6. Disable source builds where practical and accept only reviewed binary artifacts. 7. Add automated dependency scanning and a controlled upgrade process that reviews release changes before modifying the lockfile. ]]>
