T08 · Insecure Dependencies
- Location
assets/install.sh:17- Finding
Automatic installation of unpinned dependencies from a third-party package index
- Content
View full analysis
Vulnerability Details
File Location:
assets/install.sh:17-24; related installation instructions appear inSKILL.md:59-63andREADME.md:60-64
Vulnerability Type: Supply-chain exposure through mutable, unverified dependencies
Risk Level: MediumVulnerable Code
bash MIRROR="${PIP_MIRROR:--i https://pypi.tuna.tsinghua.edu.cn/simple}" echo "==> 1/5 检查依赖" if ! "$PY" -c "import psutil, yaml, jinja2" 2>/dev/null; then echo "缺少依赖,尝试安装 psutil pyyaml jinja2 ..." "$PY" -m pip install "$MIRROR" psutil pyyaml jinja2 else echo "依赖已就绪 (psutil / pyyaml / jinja2)" fiThe documentation provides the same unpinned installation pattern:
bash pip install -i https://pypi.tuna.tsinghua.edu.cn/simple psutil pyyaml jinja2Technical Analysis
The installer automatically retrieves
psutil,pyyaml, andjinja2without exact version constraints, package hashes, or a reviewed lock file. The default package source is a third-party mirror rather than the canonical package index.Package versions are therefore mutable after the Skill has been audited. If a dependency maintainer account, release, or configured mirror is compromised, a later installation can retrieve code that was not included in this audit. Python packages can execute code during installation and are subsequently imported by the monitoring process.
The installer also stores the index option and URL in one shell variable and passes it as one quoted argument:
bash "$PY" -m pip install "$MIRROR" psutil pyyaml jinja2This does not reliably represent the two command-line arguments expected by pip and may cause installation failure. It should not be addressed by unquoted expansion, because that would introduce unsafe argument splitting; an array or explicit arguments should be used instead.
Attack Path
- The user runs
bash assets/install.sh. - At least one required Python module is missing.
- The i ...[truncated 1177 chars]
- The user runs
- Remediation
View remediation
Remediation Suggestions
- Create a reviewed dependency lock file containing exact versions and cryptographic hashes.
- Install with hash verification, for example:
bash python3 -m pip install --require-hashes -r requirements.txt - Default to the canonical Python package index unless the user explicitly selects a trusted organizational mirror.
- Consider making dependency installation a separate, explicit user action instead of automatically installing packages from the setup script.
- Install dependencies into a dedicated virtual environment with only the permissions needed by the monitor.
- Pass pip options as distinct arguments using a shell array:
bash PIP_ARGS=(--index-url "https://pypi.org/simple") "$PY" -m pip install "${PIP_ARGS[@]}" --require-hashes -r requirements.txt - Regularly review and update pinned dependencies through a controlled process that includes vulnerability scanning and regression testing.
