T08 · Insecure Dependencies
Warning
- Location
- install.sh:14
- Finding
- Unpinned and Unverified Third-Party Dependency Installation## Vulnerability Details **File Location**: `install.sh`, lines 14–17 **Vulnerability Type**: Supply-chain exposure through an unpinned dependency **Risk Level**: Medium ```bash # 激活虚拟环境并安装依赖 echo "📥 安装 python-docx..." source .venv/bin/activate uv pip install python-docx ``` ### Technical Analysis The installation script installs `python-docx` without a version constraint, dependency lockfile, cryptographic hash verification, or an explicitly enforced package index. Consequently, the package and its transitive dependencies may change between installations without any change to the audited project. Because `uv pip` can use package-index configuration inherited from the execution environment, the resolved artifact may also depend on externally controlled index or resolver settings. This creates a supply-chain risk: compromise of an upstream release, configured package repository, or dependency could cause users to install code that was not part of the reviewed Skill package. The dependency is subsequently loaded by `docx-formatter.py` through imports such as `from docx import Document`. Any malicious runtime behavior introduced into the resolved package would therefore execute with the privileges of the user running the formatter. ### Attack Path 1. A user follows the installation instructions and executes `install.sh`. 2. The script creates or reuses the local virtual environment and invokes `uv pip install python-docx`. 3. The resolver obtains the current package and transitive dependency versions from its configured package index because no reviewed lockfile, version pin, or required hashes constrain resolution. 4. An attacker who has compromised an upstream package release, a configured repository, or the dependency-resolution channel supplies a malicious artifact. 5. The malicious artifact is installed into `.venv`. 6. When the user runs the formatter, Python imports the installed `docx` package, causing attacke ...[truncated 886 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `python-docx` and all transitive dependencies to reviewed versions. 2. Commit a generated `uv.lock` file and install exclusively from that lockfile, such as with `uv sync --locked`. 3. Require cryptographic hashes for resolved distributions where the selected package workflow supports them. 4. Explicitly configure the approved package index rather than implicitly trusting environment-specific resolver configuration. 5. Configure automated dependency scanning and a controlled process for reviewing and updating pinned versions. 6. Make installation fail if the lockfile is absent or resolution would modify it. 7. Avoid running the installation script with administrative privileges; retain the project-local virtual environment and least-privilege execution model.
