T08 · Insecure Dependencies
- Location
install.sh:14- Finding
Unpinned and Unverified Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
install.sh, lines 14–17
Vulnerability Type: Supply-chain exposure through an unpinned dependency
Risk Level: Mediumbash # 激活虚拟环境并安装依赖 echo "📥 安装 python-docx..." source .venv/bin/activate uv pip install python-docxTechnical Analysis
The installation script installs
python-docxwithout 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 pipcan 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.pythrough imports such asfrom 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
- A user follows the installation instructions and executes
install.sh. - The script creates or reuses the local virtual environment and invokes
uv pip install python-docx. - 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.
- An attacker who has compromised an upstream package release, a configured repository, or the dependency-resolution channel supplies a malicious artifact.
- The malicious artifact is installed into
.venv. - When the user runs the formatter, Python imports the installed
docxpackage, causing attacke ...[truncated 886 chars]
- A user follows the installation instructions and executes
- Remediation
View remediation
Remediation Suggestions
- Pin
python-docxand all transitive dependencies to reviewed versions. - Commit a generated
uv.lockfile and install exclusively from that lockfile, such as withuv sync --locked. - Require cryptographic hashes for resolved distributions where the selected package workflow supports them.
- Explicitly configure the approved package index rather than implicitly trusting environment-specific resolver configuration.
- Configure automated dependency scanning and a controlled process for reviewing and updating pinned versions.
- Make installation fail if the lockfile is absent or resolution would modify it.
- Avoid running the installation script with administrative privileges; retain the project-local virtual environment and least-privilege execution model.
- Pin
