T08 · Insecure Dependencies
- Location
SKILL.md:105- Finding
Unpinned and Unverified Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 105–109
Vulnerability Type: Unpinned third-party dependency and insufficient supply-chain verification
Risk Level: MediumComplete Code Snippet
markdown ## 依赖 ```bash pip install python-docx ```The installed package is subsequently imported by
scripts/convert_to_docx.py:python try: from docx import Document from docx.shared import Pt, Cm, Twips from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_LINE_SPACING from docx.enum.style import WD_STYLE_TYPE from docx.oxml.ns import qn from docx.oxml import OxmlElement except ImportError: print("需要安装python-docx: pip install python-docx") sys.exit(1)Technical Analysis
The installation command does not pin
python-docxto a reviewed version, verify package hashes, use a lockfile, or explicitly select a trusted package index. Its resolved package contents can therefore change independently of the audited Skill.The exact exploitation scenario depends on the user's pip configuration and the security of the selected package repository. If an attacker compromises a future package release, a transitive dependency, or a configured package index, attacker-controlled code may run during package installation, package build steps, or subsequent import by the converter.
This is a supply-chain hardening deficiency. The audit found no evidence that the project intentionally retrieves a malicious package, and
python-docxis not a typographical imitation in the reviewed instruction.Attack Path
- A user follows the dependency installation command in
SKILL.md. - Pip resolves the unpinned package from the user's configured package index.
- An attacker compromises or substitutes the resolved package, one of its dependencies, or the configured index response.
- The compromised component is downloaded and installed without hash verification.
- Malicious installation or build logic executes, ...[truncated 797 chars]
- A user follows the dependency installation command in
- Remediation
View remediation
Remediation Suggestions
- Pin
python-docxand all transitive dependencies to reviewed versions in a committed requirements or lock file. - Record cryptographic hashes and require pip to verify them:
bash python3 -m pip install --require-hashes -r requirements.txt - Explicitly use an approved package index rather than inheriting an unknown local index configuration:
bash python3 -m pip install \ --index-url https://pypi.org/simple \ --require-hashes \ -r requirements.txt - Install dependencies inside an isolated virtual environment using an unprivileged account.
- Review and update pinned dependencies through a controlled process that includes vulnerability scanning, provenance verification, and regression testing.
- Remove or synchronize the duplicate unpinned installation guidance in the script's
ImportErrormessage so users are consistently directed to the verified requirements file.
- Pin
